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

  

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 : 0 0 0

(3)

ReverseLookupP,LookupP,numcolorsP+1,fast

Error, (in ColorTools:-Palette:-ReverseLookup) invalid color ColorTools:-Color("RGB",[0., 0., 0.]) 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]