[{"data":1,"prerenderedAt":250,"buildId":251},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Feffects-overlay\u002Foverpremul":3,"github-stars":158,"guide-nav":160},{"id":4,"title":5,"body":6,"categoryId":142,"categorySlug":143,"categoryTitle":144,"curated":145,"description":146,"editUrl":147,"extension":148,"group":56,"groupTitle":149,"kind":150,"meta":151,"navigation":152,"path":153,"seo":154,"sourceUrl":155,"stem":156,"wordCount":147,"__hash__":157},"primitives\u002Fdocs\u002Fprimitives\u002F34.effects-overlay\u002F4.overpremul.md","overPremul",{"type":7,"value":8,"toc":138},"minimark",[9,13,30,51,66,69,74,134],[10,11,5],"h1",{"id":12},"overpremul",[14,15,16,17,21,22,25,26,29],"p",{},"Premultiplied Porter-Duff \"over\": composite one straight-alpha layer (",[18,19,20],"code",{},"rgb",", ",[18,23,24],{},"a",") on top of the premultiplied accumulator ",[18,27,28],{},"dst",", clamping the layer alpha.",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-ts shiki shiki-themes github-dark","overPremul(dst: string, rgb: string, a: string): string\n","ts","",[18,38,39],{"__ignoreMap":36},[40,41,44,47],"span",{"class":42,"line":43},"line",1,[40,45,5],{"class":46},"svObZ",[40,48,50],{"class":49},"s95oV","(dst: string, rgb: string, a: string): string\n",[14,52,53,54,57,58,61,62,65],{},"Import ",[18,55,56],{},"effects"," from ",[18,59,60],{},"shaders\u002Fstd"," and use ",[18,63,64],{},"effects.overlay.overPremul",".",[14,67,68],{},"One statement, brace-scoped so repeated composites in the same block don't collide on the temp.",[70,71,73],"h2",{"id":72},"parameters","Parameters",[75,76,77,93],"table",{},[78,79,80],"thead",{},[81,82,83,87,90],"tr",{},[84,85,86],"th",{},"Name",[84,88,89],{},"Type",[84,91,92],{},"Notes",[94,95,96,110,122],"tbody",{},[81,97,98,103,108],{},[99,100,101],"td",{},[18,102,28],{},[99,104,105],{},[18,106,107],{},"string",[99,109],{},[81,111,112,116,120],{},[99,113,114],{},[18,115,20],{},[99,117,118],{},[18,119,107],{},[99,121],{},[81,123,124,128,132],{},[99,125,126],{},[18,127,24],{},[99,129,130],{},[18,131,107],{},[99,133],{},[135,136,137],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":36,"searchDepth":139,"depth":139,"links":140},2,[141],{"id":72,"depth":139,"text":73},"effects.overlay","effects-overlay","Overlays",false,"Premultiplied Porter-Duff \"over\": composite one straight-alpha layer (`rgb`, `a`) on top of the premultiplied accumulator `dst`, clamping the layer alpha.",null,"md","Filters & effects","function",{},true,"\u002Fdocs\u002Fprimitives\u002Feffects-overlay\u002Foverpremul",{"title":5,"description":146},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Feffects\u002Foverlay.ts#L22","docs\u002Fprimitives\u002F34.effects-overlay\u002F4.overpremul","fUOHH4W4XF3lsvFY1HRv0JKYpNLfHD3QDRqXA_vpGfg",{"stars":159},6080,[161,165,169,173,177,181,185,189,193,197,201,205,209,213,217,221,225,230,234,238,242,246],{"path":162,"title":163,"description":164,"category":18},"\u002Fdocs\u002Fguide","Getting started","Shaders is a desktop app where your AI agent designs interactive effects on an infinite canvas, and you shape them by hand.",{"path":166,"title":167,"description":168,"category":18},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":170,"title":171,"description":172,"category":18},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":174,"title":175,"description":176,"category":18},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":178,"title":179,"description":180,"category":18},"\u002Fdocs\u002Fguide\u002Fprops-reactivity","Props and reactivity","Bind props to your framework's state so effects update when it changes, and animate props with an animation library.",{"path":182,"title":183,"description":184,"category":18},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":186,"title":187,"description":188,"category":18},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":190,"title":191,"description":192,"category":18},"\u002Fdocs\u002Fguide\u002Flayout-positioning","Layout and positioning","Size and place a shader in your page with CSS, as a background, a fill, or an inline block.",{"path":194,"title":195,"description":196,"category":18},"\u002Fdocs\u002Fguide\u002Fsizing-and-units","Sizing and units","Size and place layers in CSS units (px, %, vw, rem, and canvas units) that stay correct as the canvas and window resize.",{"path":198,"title":199,"description":200,"category":18},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":202,"title":203,"description":204,"category":18},"\u002Fdocs\u002Fguide\u002Fshape-effects","Shape effects","Pick the 2D, 3D or custom SVG shape that Glass, Neon, Emboss and other shape effects draw inside.",{"path":206,"title":207,"description":208,"category":18},"\u002Fdocs\u002Fguide\u002Fcolor-space","Color space","Match colors to your design tool with the output color space, and keep bright layers from clipping with tone mapping.",{"path":210,"title":211,"description":212,"category":18},"\u002Fdocs\u002Fguide\u002Fhooks-events","Hooks and events","Run code when an effect is ready to show, and show a fallback when the GPU can't run it.",{"path":214,"title":215,"description":216,"category":18},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":218,"title":219,"description":220,"category":18},"\u002Fdocs\u002Fguide\u002Fcustom-shaders","Custom components","Write your own component in TypeScript, use it like any component in the library, and write WGSL by hand when you need to.",{"path":222,"title":223,"description":224,"category":18},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":226,"title":227,"description":228,"category":229},"\u002Fdocs\u002Fguide\u002Fmcp","Working with your agent","The Shaders MCP connects your AI agent to the desktop app, so it can design shaders on your canvas and install them in your project.","workflows",{"path":231,"title":232,"description":233,"category":229},"\u002Fdocs\u002Fguide\u002Fcli","Working with the CLI","The Shaders CLI installs shaders from your projects and the Pro library into your codebase as component files, and keeps them in sync as you keep designing.",{"path":235,"title":236,"description":237,"category":229},"\u002Fdocs\u002Fguide\u002Fframeworks","Supported frameworks","Shaders runs in any web project that renders in a browser with WebGPU, with components for React, Vue, Svelte and Solid and a JavaScript API for everything else.",{"path":239,"title":240,"description":241,"category":18},"\u002Fdocs\u002Fguide\u002Fagent-skill","Agent skill for the engine","Teach your coding agent to write Shaders code with the open-source engine, for when it's working in your codebase instead of on the canvas.",{"path":243,"title":244,"description":245,"category":18},"\u002Fdocs\u002Fguide\u002Fvideo-rendering","Rendering to video","Render a shader effect to video frame by frame, from Remotion, Hyperframes or your own headless Chrome script.",{"path":247,"title":248,"description":249,"category":18},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051185881,"06e02370-81a6-4d74-9931-661d71414be1"]