PageSourceSearch

https://touying-typ.github.io/assets/js/06bbb73a.31ba5355.js

js touying-typ.github.io collected 2026-10-03 10:08:58 UTC 5,654 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7233],{38479:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>a,toc:()=>l});var r=t(85893),c=t(11151);const i={sidebar_position:35,description:"Cover content with a text-color-changing mechanism.",toc_max_heading_level:2},o="color-changing-cover",a={id:"reference/utils/color-changing-cover",title:"color-changing-cover",description:"Cover content with a text-color-changing mechanism.",source:"@site/docs/reference/utils/color-changing-cover.mdx",sourceDirName:"reference/utils",slug:"/reference/utils/color-changing-cover",permalink:"/docs/reference/utils/color-changing-cover",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:35,frontMatter:{sidebar_position:35,description:"Cover content with a text-color-changing mechanism.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"semi-transparent-cover",permalink:"/docs/reference/utils/semi-transparent-cover"},next:{title:"alpha-changing-cover",permalink:"/docs/reference/utils/alpha-changing-cover"}},s={},l=[{value:"color : <TypeLink></TypeLink> <Default><code>gray</code></Default>",id:"color",level:3},{value:"fallback-hide : <TypeLink></TypeLink> <Default><code>hide</code></Default>",id:"fallback-hide",level:3},{value:"transparentize-table : <TypeLink></TypeLink> <Default><code>false</code></Default>",id:"transparentize-table",level:3},{value:"it : <TypeLink></TypeLink>",id:"it",level:3},{value:"fallback-hide-args : <TypeLink></TypeLink> <Default><code>(:)</code></Default>",id:"fallback-hide-args",level:3}];function d(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,c.a)(),...e.components},{Default:t,Param:i,Parameters:o,Signature:a,SignatureName:s,SignatureParam:l,SourceLink:d,TypeLink:h}=n;return t||p("Default",!0),i||p("Param",!0),o||p("Parameters",!0),a||p("Signature",!0),s||p("SignatureName",!0),l||p("SignatureParam",!0),d||p("SourceLink",!0),h||p("TypeLink",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"color-changing-cover",children:"color-changing-cover"}),"\n",(0,r.jsx)(a,{children:(0,r.jsxs)("code",{children:[(0,r.jsx)(s,{children:"color-changing-cover"}),"(",(0,r.jsxs)(l,{children:[(0,r.jsx)(n.a,{href:"#self",children:"self: none"}),", "]}),(0,r.jsxs)(l,{children:[(0,r.jsx)(n.a,{href:"#color",children:"color: gray"}),", "]}),(0,r.jsxs)(l,{children:[(0,r.jsx)(n.a,{href:"#fallback-hide",children:"fallback-hide: hide"}),", "]}),(0,r.jsxs)(l,{children:[(0,r.jsx)(n.a,{href:"#transparentize-table",children:"transparentize-table: false"}),", "]}),(0,r.jsxs)(l,{children:[(0,r.jsx)(n.a,{href:"#fallback-hide-args",children:"fallback-hide-args: (:)"}),", "]}),(0,r.jsx)(l,{children:(0,r.jsx)(n.a,{href:"#it",children:"it"})}),")",(0,r.jsx)(d,{href:"https://github.com/touying-typ/touying/blob/main/src/utils.typ#L1553"})]})}),"\n",(0,r.jsx)(n.p,{children:"Cover content with a text-color-changing mechanism."}),"\n",(0,r.jsxs)(n.p,{children:["Example: ",(0,r.jsx)(n.code,{children:"config-methods(cover: utils.color-changing-cover.with(color: gray))"})]}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsxs)(n.h3,{id:"color",children:["color : ",(0,r.jsx)(h,{type:"color"})," ",(0,r.jsx)(t,{children:(0,r.jsx)(n.code,{children:"gray"})})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(n.p,{children:["The color to apply to text when covered. Default is ",(0,r.jsx)(n.code,{children:"gray"}),"."]})}),(0,r.jsxs)(n.h3,{id:"fallback-hide",children:["fallback-hide : ",(0,r.jsx)(h,{type:"func"})," ",(0,r.jsx)(t,{children:(0,r.jsx)(n.code,{children:"hide"})})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(n.p,{children:["The function to use to hide the content if it does not contain text. Default is typst's own ",(0,r.jsx)(n.code,{children:"hide"}),". You may pass ",(0,r.jsx)(n.code,{children:"none"})," to not hide non-text content. To hide content with a semi-transparent/color overlay, you can pass in ",(0,r.jsx)(n.code,{children:"semi-transparent-cover"}),"/",(0,r.jsx)(n.code,{children:"cover-with-rect.with(fill: ...)"}),"."]})}),(0,r.jsxs)(n.h3,{id:"transparentize-table",children:["transparentize-table : ",(0,r.jsx)(h,{type:"bool"})," ",(0,r.jsx)(t,{children:(0,r.jsx)(n.code,{children:"false"})})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(n.p,{children:["Whether to transparentize table content. Default is ",(0,r.jsx)(n.code,{children:"false"}),"."]})}),(0,r.jsxs)(n.h3,{id:"it",children:["it : ",(0,r.jsx)(h,{type:"content"})]}),(0,r.jsx)(i,{children:(0,r.jsx)(n.p,{children:"The content to cover."})}),(0,r.jsxs)(n.h3,{id:"fallback-hide-args",children:["fallback-hide-args : ",(0,r.jsx)(h,{type:"dict"})," ",(0,r.jsx)(t,{children:(0,r.jsx)(n.code,{children:"(:)"})})]}),(0,r.jsx)(i,{children:(0,r.jsx)(n.p,{children:"The named arguments to pass to the fallback hide function if the content does not contain text."})})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Returns:"})," ",(0,r.jsx)(h,{type:"content"})]})]})}function h(e={}){const{wrapper:n}={...(0,c.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}function p(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>o});var r=t(67294);const c={},i=r.createContext(c);function o(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.