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 components into a single color value, or any combination thereof.

Conversion between every color model is currently not supported and may fail, e.g. RGB and CMYK since that can’t be done accurately without device dependent color profiles, 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) factor override [0,1].

Returns