ColorTools[Palette]
KnownColor
check if a string is a valid color name in a palette
Calling Sequence
Parameters
Description
Examples
Compatibility
KnownColor(P,color)
P
-
Palette object created with ColorTools:-Palette
color
string or a positive integer
The KnownColor command returns true if color is the name of a color in the palette P. It is useful for avoiding the errors thrown by the Lookup command for colors not in a palette.
P≔ColorTools:-GetPaletteCSS
P≔Palette CSS:BlackRedMaroonOrangeYellowOliveLimeGreenAquaTealBlueNavyFuchsiaPurpleGraySilverWhite
KnownColorP,Grey
true
KnownColorP,Gray
KnownColorP,Griy
false
An error will be thrown if a color is not in a palette
LookupP,Griy
Error, (in ColorTools:-Palette:-Lookup) invalid color Griy is not defined in this palette
The ColorTools[Palette][KnownColor] command was introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
See Also
ColorTools[Palette][Lookup]
Download Help Document