ColorTools[Palette] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : Packages : ColorTools : Palette Object Commands : ColorTools/Palette/Lookup

ColorTools[Palette]

  

Lookup

  

look up a color in a Palette object by name or index

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Lookup(P,color)

Lookup(P,color,fast,shade=type)

Parameters

P

-

Palette object created with ColorTools:-Palette

color

-

string or a positive integer

fast

-

(optional) keyword option

shade

-

(optional) keyword option of the form shade=type, where type can be one of fill, line, or point

Description

• 

The Lookup command looks up color in P.

• 

The argument color can be a string that is the name of a color in P or a positive integer index.

• 

If fast is given, P will not be expanded automatically when a numeric index is given beyond the current size of the palette.

• 

The shade option controls the automatic transformation of colors of P for use with different plot objects. For example, if you make a plot with a point, a line, and a filled region and want their colors to look similar on a white background, you could use the colors returned by Lookup(P,1,shade="point"), Lookup(P,1,shade="line"), and Lookup(P,1,shade="fill") respectively.

• 

The fast and shade options do not apply to palette of type dictionary.

Examples

PColorTools:-GetPalettespring

PPalette Spring:BlueRoseYellowGreenBlueGreenVioletCobaltYellowPurpleRedGreenBluePaleGreenOrangePurpleGreenSeaBluePaleYellowPaleBlueGreen

(1)

LookupP,1

RGB : Blue

(2)

LookupP,Purple

RGB : Purple

(3)

LookupP,1,shade=fill

RGB : 0.29 0.522 0.83

(4)

LookupP,Cobalt,shade=point

RGB : 0.0814 0.431 0.623

(5)

LookupP,10

RGB : Pale Green

(6)

LookupP,numcolorsP+1

RGB : 1 0.516 0.589

(7)

An error will be thrown if fast is specified and color is an integer larger than the number of original colors in the palette

LookupP,numcolorsP+100,fast

Error, (in ColorTools:-Palette:-Lookup) invalid color 116 is not defined in this palette

An error will also be thrown if color is a string and not the name of a color in the palette.

LookupP,Blurple

Error, (in ColorTools:-Palette:-Lookup) invalid color Blurple is not defined in this palette

Compatibility

• 

The ColorTools[Palette][Lookup] command was introduced in Maple 16.

• 

For more information on Maple 16 changes, see Updates in Maple 16.

See Also

ColorTools[Palette]