Number Range to Color
Intro
Remap values to colors based on a gradient.
UI
Source Minimum - The smallest value within the range.
Source Maximum - The largest value within the range.
Value - Connect a range of values (e.g. from a Spreadsheet Utility).
Gradient - The Source Minimum value is remapped to the color value set on the far left of the gradient, the Source Maximum value is remapped to the color value set on the far right of the gradient.
Clamp - When checked, the output will never go above or below the Maximum or Minimum values.
This layer is also used as a base for options on the Spreadsheet Utility. The Value attribute will not appear within the Spreadsheet's Attribute Editor UI as that is being driven by the data on the Layer itself.
- Create 2 Shapes (shape1 and shape2).
- Create a Number Range to Color.
- Set:
- Source Minimum =
-100
- Source Maximum =
100
- Connect shape1.position.y→numberRangeToColor.value.
- Connect numberRangetoColor.id→shape2.fillColor.
- Move Shape1 up and down in the Viewport.
As Shape1 reaches a position of 100 in the Y axis, Shape2's** Fill Color** will be set to white (the far right of the gradient). As it moves down to a position of -100 in Y, Shape2's Fill Color will move towards black (the far left of the gradient). If Clamp is checked then as Shape1 moves above 100, Shape2 will remain white.
Regardless of the values entered in Minimum and Maximum, the smallest value will always be used as the Minimum and the largest value as the Maximum. For example, where the value entered into the Minimum attribute is actually larger than the Maximum attribute, those values will be inverted as part of the Layer's calculation.