Lookup - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


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.217 0.558 0.898

(4)

LookupP,Cobalt,shade=point

RGB : 0.236 0.443 0.6

(5)

LookupP,10

RGB : Pale Green

(6)

LookupP,numcolorsP+1

RGB : 0 0 0

(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]