Skip to main content

vJSONColorMap

Turns a number per point into a color between Color A and Color B.

IntermediateMograph / JSONJSONArrayScriptVal
vJSONColorMap node

vJSONColorMap reads a value for each index from the index, a scalar array, a point coordinate or the distance to a center, and outputs a list of RGBA colors. The color runs from Color A at the low end of the range to Color B at the high end.

Parameters​

ParameterTypeDefaultDescription
SourceDropdownIndexIndex (default), Scalar Input, Position X, Position Y, Position Z or Distance From Center. The position and distance sources give 0 when no Points are connected.
Auto RangeInteger1.0Uses the smallest and largest value as the range when on (default).
RangeMinFloat0Low end of the manual range. Used when Auto Range is off. Default 0.
RangeMaxFloat1High end of the manual range. Used when Auto Range is off. Default 1.
Clamp 0-1Integer1.0Limits the position along the gradient to 0 to 1 when on (default).
+15 more parameters
ParameterTypeDefaultDescription
InvertInteger0.0Reverses the gradient when on. Default off.
Fallback CountInteger100Number of colors when neither Points nor Scalars are connected. Minimum 1, default 100.
Center XFloat0X of the center for Distance From Center. Default 0.
Center YFloat0Y of the center for Distance From Center. Default 0.
Center ZFloat0Z of the center for Distance From Center. Default 0.
RedFloat0.1Red of Color A, at the low end. Default 0.1.
GreenFloat0.4Green of Color A. Default 0.4.
BlueFloat1.0Blue of Color A. Default 1.
AlphaFloat1.0Alpha of Color A. Default 1.
RedFloat1.0Red of Color B, at the high end. Default 1.
GreenFloat0.2Green of Color B. Default 0.2.
BlueFloat0.2Blue of Color B. Default 0.2.
AlphaFloat1.0Alpha of Color B. Default 1.
PointsText—Optional points. They set the count and feed the position and distance sources.
ScalarsText—Optional numbers. They feed the Scalar Input source.
Read the full description

The number of colors is the number of Points, else the number of Scalars, else Fallback Count (default 100). Source picks the value per index: the index, the Scalar Input value (the first value of a list), Position X, Y or Z of the point, or its distance to Center X, Y and Z.

With Auto Range on, the smallest and largest value become the range, otherwise Range Min and Range Max do. The position t is (value - min) / (max - min), clamped to 0 to 1 if Clamp 0-1 is on, then flipped to 1 - t if Invert is on. The color is Color A + (Color B - Color A) * t per channel, limited to 0 to 1.

A range of zero width gives t = value - min. The output is a ScriptVal list, for example for the Custom Color input of vJSONShapeRender.

Example Connections​

vJSONPointsOnGrid.Output -> vJSONColorMap.Points
vJSONPointsOnGrid.Output -> vJSONCameraProjection.ArrayA
vJSONCameraProjection.Output -> vJSONShapeRender.ArrayPoint
vJSONColorMap.Output -> vJSONShapeRender.JSONCustomColor
Background.Output -> vJSONShapeRender.Input