isZero

Skip the filter entirely while prop is exactly 0.

isZero(prop: string): IdentityRule

Import isZero from shaders/std.

Put it on identityWhen:. An unset prop counts as its default. A prop that is mapped per pixel by a driver disables the skip automatically, since the value then varies across the canvas. Give the prop recompile: crosses(0) so the skip switches on and off.

Parameters

NameTypeNotes
propstring

Example

identityWhen: isZero('intensity')

See also

  • isValue — Skip the filter entirely while prop equals value, for a filter whose no-op is not 0.
  • allOf — Skip the filter only while every rule holds, for a no-op that needs several props at rest.
  • crosses — Rebuild the shader only when the prop crosses value, not on every change.

Used by

BrightnessContrast, FilmGrain, GradientMap, HueShift, Sharpness, Solarize, Sparkle, Vibrance, Vignette