Gradient Mapping

Block Group: Number Formatting
Icon:Gradient Mapping block icon

The Gradient Mapping block correlates a number range to a color gradient and returns an output color that corresponds to an input number.

For information on using dataflow blocks, see Dataflow.

For accepted and excluded arguments of Number Formatting blocks, see Number Formatting.

Input/Output Properties

The following properties of the Gradient Mapping block can take input and give output.

  • gradient (gradient)
  • input (number)
  • min (number)
  • max (number)

gradient defines the colors for the gradient scale. Colors at the left of the track correspond to the beginning of the number range, and colors at the right of the track correspond to the end of the number range. For information about editing gradients, see Fill and Border Pop-Ups.

input specifies the number to translate to a color in the gradient.

min specifies the minimum of the number scale, corresponding to the left end of the gradient.

max specifies the maximum of the number scale, corresponding to the right end of the gradient.

Output Property

The following property of the Gradient Mapping block can give output. They cannot take input.

  • output (color)

output returns the color in the gradient that corresponds to input's position in the number range.


The following image demonstrates an example of the Gradient Mapping block. In this example, a blue color is defined for low room temperatures, around 60° Fahrenheit. A green color is defined for mid-range temperatures and a red color for high temperatures. Because the input is close to the middle of the range, a green color is returned.

Gradient Mapping block example