coverageMix

Blends from a background color to a light color by a coverage field, as a finished paint.

coverageMix(slots: {color: PropRef; background: PropRef; coverage: LightValue; hint?: string}): LightValue

Import light from shaders/std and use light.coverageMix.

color and background are color props, coverage a 0–1 light such as a withFrame result. Both the color and the alpha blend, so a transparent background gives a light that fades to nothing. Pass a hint name when the coverage is expensive. Use coverageOver when you want real layer compositing instead of a plain blend.

Parameters

NameTypeNotes
slots{color: PropRef; background: PropRef; coverage: LightValue; hint?: string}

Example

paint: coverageMix({color: p('color'), background: p('background'), coverage: withFrame(radialFrame(p('center')), glowPoint({sharpness: 6}), 'glow'), hint: 'glowAlpha'})

See also

  • coverageOver — Lays a light color over a background color by a coverage field, like a layer with an opacity mask, as a finished paint.
  • withFrame — Evaluate a light part in a frame.

Used by

SunBurst