colorRecode

value colorRecode(color, transform, alpha)

Returns color transcoded according transform, optionally with alpha.

Used for converting between color models, decoding (unpack) a single color value into an array of color components, encoding (pack) an array of color components into a single color value, or any combination thereof.

For consistency, the element in an array of color components are always numbers between 0 and 1, even if they represent degrees such as in Hue, etc..

Transform “stages”, names are case-insensitive:

Examples

Parameters

  1. colorarray of color components, or encoded color number or text.
  2. transformtext with space-separated list of one or more transformation “stages”, interpreted from left to right.
  3. alpha — optional alpha (transparency) override [0..1].

Returns