KnownColor - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ColorTools[Palette]

  

KnownColor

  

check if a string is a valid color name in a palette

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

KnownColor(P,color)

Parameters

P

-

Palette object created with ColorTools:-Palette

color

-

string or a positive integer

Description

• 

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.

Examples

PColorTools:-GetPaletteCSS

PPalette CSS:BlackRedMaroonOrangeYellowOliveLimeGreenAquaTealBlueNavyFuchsiaPurpleGraySilverWhite

(1)

KnownColorP,Grey

true

(2)

KnownColorP,Gray

true

(3)

KnownColorP,Griy

false

(4)

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

Compatibility

• 

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]