[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)

I fixed the regex adding color swatches to anything it matches like an RGB code - it was updating the styling too - should be fixed now.

The rangeValue returns a matching value like so:

rangeValue(input, defaultValue, point1, value1, ..., pointN, valueN)

it takes the input and starts comparing it with each point, if the input is found to be larger or equal to a point, the value corresponding to that point is used instead of the default.

rangeValue(10, ‘#000000’, 3, ‘#400000’, 6, ‘#800000’, 9, ‘#c00000’, 12, ‘#f00000’) returns ‘#c00000’ as input (10) is only larger than the 3rd point, not the 4th.

there is another perhaps better choice:

rainbowValue(input, min, minColor, max, maxColor)

This will return a color between minColor and maxColor, keeping the scale between min and max. Thanks to @ahndee for the inverse HSL gradient idea

rainbowValue(75, 60, 'Blue', 90, 'Red') will give you green #00ff00

5 Likes