grasshopper2 Rhinorhino3d.com
ComponentDisplay
Gradient Functions
00000000-4f31-4b6c-ba06-05e4913e60b7
object preview

Extract the interpolation functions of a colour gradient. Gradients in Grasshopper 2 are defined using a collection of colour grips, a colour space, and an interpolation scheme.

Each grip is a pairing of a number and a colour, thus defining what the colour of a gradient is at a specific value.

The gradient colour space converts the grip colours into three numeric values each, according to the equations of the space. Incidentally, this is why CMYK is not a valid colour space for gradients, since it is the only colour model in Grasshopper which requires four numbers to encode a single colour.

Finally, the interpolation scheme creates functions which interpolate between the three numeric values of all the grips. This results in three separate interpolation functions. For example; if the gradient colour space is set to RGB, the first interpolation function encodes the amount of red, the second function encodes the amount of green and the last function encodes the amount of blue across the entire gradient. If, on the other hand, the colour space is set to L*a*b*, the first interpolation function encodes the luminance, while the remaining two encode the red-green and blue-yellow opponents.

1
2
2
3
4
5
Example file GradientFunctions.ghz.Interactive in Grasshopper 2
Draw the interpolation functions of a gradient in the Rhino viewport. The gradient interpolation scheme and colour space can be adjusted using the preset pickers. Note that the first function tends to contain very large numbers compared to the second and third functions in the case of hue-saturation based colour spaces.