ColorTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : Packages : ColorTools : ColorTools/SortPalette

ColorTools

  

SortPalette

  

sort colors into a good palette order

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

SortPalette(colors)

SortPalette(colors, opts)

Parameters

colors

-

a list of colors in formats recognized by ColorTools

opts

-

optional arguments for the Distance computations

Description

• 

The SortPalette command sorts a list of colors so that the earlier colors are as far apart as possible in the sense of the metric used by the Distance command.  In the resulting palette, the earlier colors will be more visually distinguishable, which can be useful when using the palettes for plotting.

• 

The first color of the list colors will remain the first color.

• 

Arguments other than the list of colors will be passed as options to the color Distance command.

Examples

withColorTools:

origpGetPaletteHTML[]:

origp1..5

RGB : Black,RGB : Dim Gray,RGB : Gray,RGB : Dark Gray,RGB : Silver

(1)

randporigpcombinat[randperm]`$`1..nopsorigp:

randp1..5

RGB : Moccasin,RGB : Pale Turquoise,RGB : Hot Pink,RGB : Burlywood,RGB : Olive

(2)

sortedpSortPaletterandp:

sortedp1..5

RGB : Moccasin,RGB : Blue,RGB : Dark Green,RGB : Red,RGB : Lime

(3)

withplots:

displayArraydisplayseqplotxi,x=5..10,thickness=4,color=origpi,i=1..5,displayseqplotxi,x=5..10,thickness=4,color=randpi,i=1..5,displayseqplotxi,x=5..10,thickness=4,color=sortedpi,i=1..5,size=400,200

Compatibility

• 

The ColorTools[SortPalette] command was introduced in Maple 18.

• 

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

See Also

ColorTools

ColorTools/ColorSpaces

ColorTools[Distance]