tintToward

Mix the child's color toward one color by an amount, leaving its alpha alone.

tintToward(color: PropRef, opts: {amount: ScalarInput}): TintTowardEffect

Import tintToward from shaders/std.

color is a color prop. amount runs 0 (no change) to 1 (fully that color) and can be a number, a prop, or a value that varies per pixel such as a mask. Pointwise.

Parameters

NameTypeNotes
colorPropRef
opts{amount: ScalarInput}

Example

effect: tintToward(p('color'), {amount: radialMask({center: p('center'), radius: p('radius'), falloff: p('falloff')}).times(p('intensity'))})

Tip. Pair it with identityWhen: isZero('intensity') so the filter costs nothing at zero.

See also

  • paintThrough — Show a paint through the child, so the child becomes the mask.
  • pointwise — Write your own pointwise effect: a function of the child's color at this pixel.

Used by

Vignette