ColorTools
HexToString
look up color name by hex string
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
HexToString(hex, opts)
hex
-
string; hex code for color, can be "#rrggbb" or "rrggbb"
opts
(optional) equation(s) of the form option=value where option is new or default
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
The HexToString procedure converts from a hex color value to a translated color name (based upon the current locale in the Maplets context).
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.
with⁡ColorTools:
HexToString⁡#00FF00
Lime
HexToString⁡#0F0,new=false
green
HexToString⁡FF0000
Red
HexToString⁡F00
HexToString⁡I like cat videos
Error, (in ColorTools:-HexToString) invalid hex color value: I like cat videos
The ColorTools[HexToString] command was introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
See Also
ColorTools[HexToRGB24]
Download Help Document