ColorTools
SortPalette
sort colors into a good palette order
Calling Sequence
Parameters
Description
Examples
Compatibility
SortPalette(colors)
SortPalette(colors, opts)
colors
-
list of colors in formats recognized by ColorTools or a Palette object.
opts
optional arguments for the Distance computations
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.
with⁡ColorTools:
origp≔GetPalette⁡HTML:
origp1..5
〈RGB : Alice Blue〉,〈RGB : Antique White〉,〈RGB : Aquamarine〉,〈RGB : Azure〉,〈RGB : Beige〉
randp≔origpcombinatrandperm⁡`$`⁡1..nops⁡origp:
randp1..5
〈RGB : Slate Blue〉,〈RGB : Dark Magenta〉,〈RGB : Olive Drab〉,〈RGB : Indian Red〉,〈RGB : Midnight Blue〉
sortedp≔SortPalette⁡randp:
sortedp1..5
〈RGB : Slate Blue〉,〈RGB : Lime〉,〈RGB : Red〉,〈RGB : Dark Green〉,〈RGB : Black〉
with⁡plots:
display⁡Array⁡display⁡seq⁡plot⁡x⁢i,x=5..10,thickness=4,color=origpi,i=1..5,display⁡seq⁡plot⁡x⁢i,x=5..10,thickness=4,color=randpi,i=1..5,display⁡seq⁡plot⁡x⁢i,x=5..10,thickness=4,color=sortedpi,i=1..5,size=400,200
The ColorTools[SortPalette] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
ColorTools/ColorSpaces
ColorTools[Distance]
Download Help Document