ColorTools[Palette] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

ColorTools[Palette]

  

ReverseLookup

  

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

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

ReverseLookup(P,color)

ReverseLookup(P,color,fast)

Parameters

P

-

Palette object created with ColorTools:-Palette

color

-

a color in any format understood by ColorTools

fast

-

(optional) keyword option

Description

• 

The ReverseLookup command finds if a color is part of palette P and if so, returns its positive integer index in P.

• 

If color is not a member of P and error will occur.

• 

If fast is specified, the colors generated when P is expanded automatically will not be checked during the reverse lookup.

Examples

PColorTools:-GetPalettespring

PPalette Spring:BlueRoseYellowGreenBlueGreenVioletCobaltYellowPurpleRedGreenBluePaleGreenOrangePurpleGreenSeaBluePaleYellowPaleBlueGreen

(1)

ReverseLookupP,P1

Blue

(2)

Using the fast option with ReverseLookup will not check for colors generated by automatic palette expansion.

LookupP,numcolorsP+1

RGB : 1 0.516 0.589

(3)

ReverseLookupP,LookupP,numcolorsP+1,fast

Error, (in ColorTools:-Palette:-ReverseLookup) invalid color ColorTools:-Color("RGB",[1.000000000, .5158903903, .5886421396]) is not in the palette

Compatibility

• 

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

• 

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

See Also

ColorTools[Palette]