Color Map

Map colours onto geometry through a gradient or ramp lookup.

What it does

Color Map runs a value through a colour Gradient. The value can be an image, a scalar field such as a Pattern, a single number, or a set of shapes. Low source values take the colour at the start of the gradient, high values the colour at the end. Phase and Period offset and repeat the gradient, so one ramp can cycle or scroll across the value range.

Behaviour follows what is plugged into Input. On an image or field, a channel is sampled per pixel (Red, Green, Blue, Alpha, Luminance, Hue, Saturation or Lightness) and either the RGB, the Alpha, or all of RGBA is repainted with the gradient result. On a set of shapes, a float attribute is read per element, position along a path, index, age, or any other numeric attribute stored earlier, and the resulting colour is written to Fill or Stroke.

When to use it

ParameterTypeDefault
inputOneOf([FieldOf(Raster), FieldOf(Volume), Number, NumberArray, Collection])
gradientGradientGradient(Gradient { stops: [GradientS...
source_attributeString"u"
color_targetString"Fill"
source_channelString"Luminance"
modify_targetString"RGB"
phaseNumber0
periodNumber1
interpolationString"Linear"
strengthNumber1

Gotchas

Which parameters matter depends on Input. Source Channel and Modify Target take effect on an image or field only; Source Attribute and Color Target take effect on a set of shapes only. Both groups stay visible together, so half of them can be ignored for any given input.

Period cannot reach zero. It is clamped away from zero internally so the gradient never divides by nothing, but very small values spin the gradient extremely fast. Keep Period near 1 for a single, non-repeating pass across the gradient.

Source Attribute defaults to u, normalised position along a curve or outline. It can point at any numeric attribute on the shapes, such as index or a custom one written earlier in the graph, for example age.

Worked example

  1. Add a Color Map node and wire a Pattern, or any greyscale field or image, into Input.

  2. Edit Gradient to build the colour ramp: a heat map, a duotone, whatever suits.

  3. Leave Source Channel on Luminance and Modify Target on RGB to recolour the whole image from its brightness.

  4. Lower Period below 1 to repeat the gradient several times across the value range, or animate Phase to scroll it.

See also

Stroke · Mutate · Sort · Colour fields