standardPalette

The color for a 0–1 value from the standard palette props: colorA, colorB, stops, colorSpace.

standardPalette(t: Expr, params: GpuFragmentParams): Expr

Import paint from shaders/std and use paint.standardPalette.

Declare those four props (stops: colorStopsPropConfig(), colorSpace marked compileTime). It has the shape of a Palette, so it drops straight into rampOver, or call it yourself inside a paint: function.

Parameters

NameTypeNotes
tExpr
paramsGpuFragmentParams

Example

paint: rampOver(scaledVolume(noiseField('mx3'), {scale: p('scale')}), standardPalette)

See also

  • stops — The standard multi-stop palette, read from the stops, colorA and colorB props.
  • pair — A palette of two color props, mixed in the color space named by the space prop.

Used by

MeshGradient