SortPalette - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ColorTools

  

SortPalette

  

sort colors into a good palette order

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

SortPalette(colors)

SortPalette(colors, opts)

Parameters

colors

-

list of colors in formats recognized by ColorTools or a Palette object.

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 : Alice Blue,RGB : Antique White,RGB : Aquamarine,RGB : Azure,RGB : Beige

(1)

randporigpcombinatrandperm`$`1..nopsorigp:

randp1..5

RGB : Slate Blue,RGB : Dark Magenta,RGB : Olive Drab,RGB : Indian Red,RGB : Midnight Blue

(2)

sortedpSortPaletterandp:

sortedp1..5

RGB : Slate Blue,RGB : Lime,RGB : Red,RGB : Dark Green,RGB : Black

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