RGB24ToName - Maple Help

# Online Help

###### All Products    Maple    MapleSim

ColorTools

 RGB24ToName
 look up color name by 24-bit color value

 Calling Sequence RGB24ToName(rgb,opts)

Parameters

 rgb - list; [r,g,b] color values, integer values 0-255 opts - (optional) equation(s) of the form option=value where option is one of new or default

Options

 • new boolean : indicates whether to restrict to new color names (true), old color names (false), or no restriction (the default)
 • default string : default value to return when there is no match

Description

 • The RGB24ToName procedure converts from RGB color values to a color name.
 • The new option acts as follows:

new=true: only search new color names

new=false: only search old color names

default (option new not specified): search both new and old color names

 • If a default value is provided, then that is returned when no match is found, otherwise an error occurs.

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $\mathrm{RGB24ToName}\left(\left[0,255,0\right]\right)$
 ${"Lime"}$ (1)
 > $\mathrm{RGB24ToName}\left(\left[0,255,0\right],\mathrm{new}=\mathrm{false}\right)$
 ${"green"}$ (2)
 > $\mathrm{RGB24ToName}\left(\left[255,0,0\right]\right)$
 ${"Red"}$ (3)
 > $\mathrm{RGB24ToName}\left("I like cat videos"\right)$

Compatibility

 • The ColorTools[RGB24ToName] command was introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.

 See Also