This topic provides a reference table for all automatic type conversions to colour, sorted by merit.
Direct Conversions
This section lists all direct
conversions to the colour type. A 'Direct' conversion indicates a relation between very related types, such as integers and numbers, or 2D and 3D points. Though note that even these conversions can fail due to out-of-bounds issues, or be narrowing due to reduction.
| From | Explanation |
|---|---|
| Colour (RGB) | Converts RGB color to general color representation. |
Plausible Conversions
This section lists all plausible
conversions to the colour type. A 'Plausible' conversion indicates a non-straightforward, but a still reasonable conversion between two types that share a salient quality, or where one is an obvious sub-type of the other. For example curves and intervals, or points and planes. Any plausible conversion can also be achieved through the explicit use of standard components.
| From | Explanation |
|---|---|
| angle | Maps the angle to the hue channel of a color. |
| boolean | Converts false to black, true to white. |
| complex number | Maps complex argument to hue and modulus to saturation. |
| gradient | Extracts the average color of the gradient. |
| number | Maps the entire number line onto a black-to-white gradient. |
| vector | Maps (X,Y,Z) components to (R,G,B) color channels. |
Strange Conversions
This section lists all strange
conversions to the colour type. A 'Strange' conversion indicates a peculiar, but occasionally sensible, translation between types. However, it is equally likely that the conversion was not intended and thus represents a mistake in the algorithm design, which is why this conversion level is the default for showing conversion warnings in the Grasshopper interface. Examples in this category include the conversion between colours and booleans, or between circles and triangles. Any strange conversion can also be achieved through the explicit use of standard components.
| From | Explanation |
|---|---|
| plane | Maps the plane normal vector to (R,G,B) channels. |
Weird Conversions
This section lists all weird
conversions to the colour type. A 'Weird' conversion indicates an exotic relationship between types which is almost certainly unintended on the part of the user. However, very occasionally these conversions make sense and allow the user to avoid the use of several components to achieve the same result. Examples in this category include conversions between planes and integers, or points and intervals.
| From | Explanation |
|---|---|
| integer | Converts zero to black and everything else to white. |
| integer (big) | Converts zero to black and everything else to white. |