approach | Moves `current` towards `target` by at most `step`: a linear fade, `delta / seconds` a frame. |
between | Where `value` is between `start` and `end`, 0..1: a step at `start` when `end` is not past it. |
chase | Moves `at` towards `aim` with `damp` on both axes and lands on it once within `near` (a distance), like `damp`'s own `near`. Returns whether it is still on its way, which an update can return to keep frames coming. `seconds` 0 jumps. |
cornerRadius | The radius of the corner `point` is nearest to, for `point` from the box centre with y up and `corners` the four radii of `radii` (top left, top right, bottom right, bottom left), for a `roundedBox` with corners that differ. |
damp | Exponential approach, frame-rate independent: `seconds` is the time to cover ~63%, 0 jumps. Within `near` of the target it lands there, so a caller can tell when it has settled. Without `near` it lands only when floating point reaches the target, seconds later: to stop drawing once it settles, pass a step too small to see, such as 0.5 for px or 1e-3 for a 0..1 value. |
dither | ±0.5/255 from the integer hash of the screen pixel, against banding in gradients. With `rgb`, ±0.5/255 after the sRGB encoding of that linear colour: the dither scaled by the slope of the decoding curve there, so dark gradients get as much as light ones. Add it to the colour. |
ease | Easing curves on 0..1, clamped. |
entering | Scroll progress of a box coming into view, 0..1: 0 while less than `share` of it shows, 1 once it is centred in the viewport. `progress` is `input.progress`, `height` the box height and `viewport` the viewport height in px. |
flags | Reads a switch list param such as `close="esc backdrop swipe"`: the known names it holds, in any order, separated by spaces or commas. `'all'` or `'*'` turns on all of them, an empty string none. Unknown names are left out and returned, so the effect can note them once. |
follow | Follows the pointer the way a light or a brush on an element wants it: a mouse or pen while it is over the element, the first finger while it is pressed on it. Touch never blocks the page's scroll: the browser takes the finger with `pointercancel` when one starts. Each change asks for a frame. Listeners go with `ctx.signal`. Returns the live pointer; `on` adds callbacks. |
fresnel | Schlick's Fresnel: the share of light a surface reflects at `cosine` between its normal and the view, `f0` head-on (0.04 for glass and plastic, 0.02 for water). Edges catch more light. |
fromOklab | Linear sRGB of an OKLab colour into `out`, clamped to the gamut. |
inView | Whether `share` 0..1 of a box is in view, counted above the bottom tenth of the viewport: a box peeking in at the edge has not been looked at yet. `top` and `height` are the box's in viewport px (`input.y`, `input.height`), `viewport` the viewport height. An empty box never is. |
maxTextureSize | Largest 2D texture side the device takes: the WebGPU device limit (8192 for three r187, which asks for default limits), WebGL 2 `MAX_TEXTURE_SIZE`, else 4096. Caps decodes of big pictures. |
mixOklab | `a` and `b` mixed in OKLab by `t` 0..1, into `out`. |
noise | Tiling value noise, baked on the CPU, linear, RepeatWrapping. Shared per renderer and options with a reference count tied to `ctx`: never dispose it. |
oklabToLinear | `fromOklab` in a shader: linear sRGB of an OKLab colour, clamped to the gamut. |
palette | The colours of a list as `#rrggbb`, such as a brand palette in a param: any CSS colour, `var(--brand)` (its value or fallback, followed 8 levels deep) and `currentColor` read from the element's computed style, as `cssColor` of `@dioramajs/render` reads them. Spaces and commas outside parentheses separate the colours; words that are no colour are left out. Read at the call: a later change of a variable shows when the effect reads the list again. |
radii | The corner radii of an element in px as CSS draws them: top left, top right, bottom right, bottom left. A `%` counts against the shorter side of the `width` × `height` box, and no corner takes more than half of that side, so `999px` draws a pill. |
rng | mulberry32: the same sequence for the same seed on every load and backend. |
roundedBox | Signed distance in px from a rounded box, negative inside: `point` from the box centre, `half` its half size, `radius` its corners. `clamp(0.5 - d, 0, 1)` is a 1 px antialiased mask. |
spiralBlur | A soft blur: the mean of `taps` reads on a golden-angle spiral over the disc of `radius` (in the units of `uv`) around `uv`. `turn` rotates the spiral; turned per pixel, the taps read as grain instead of ghost copies. One tap reads `uv` itself. |
toBox | A point in client px, such as an event's `clientX` and `clientY`, in px of `box` from its bottom left: the units of the shader's `box` times `u.size`. Pass `input` as the box in the update, since the page may scroll under a still pointer. Writes into `out` when given. |
toOklab | OKLab (Björn Ottosson) of a linear sRGB colour, three's working space. Mixed in OKLab, two colours meet through a clean middle instead of a muddy grey. |