ColorTools
Palette
construct a palette data structure
Calling Sequence
Parameters
Description
Creating New Palettes
Examples
Compatibility
Palette(colors)
Palette(colors, palettetype=type )
colors
-
list of colors in formats recognized by ColorTools, or a list of equations of the form string=color.
type
type of palette given as a string. Choices are dictionary, colormap, fill, line, and point. A dictionary palette is intended to store an association of colors and names. A colormap is optimized for large precomputed gradients. The other palette types specify a collection of colors intended for use in plotted figures of the given type. In general, darker, more saturated colors are better for points and lines while lighter, less saturated colors are better for fills.
A palette data structure is an object that stores a collection of named colors in a specified order.
There are many existing Palettes that are Color Collections for use by users and used by many visualization routines.
The GetPaletteColors command is the easiest way to get all the colors in the a palette, but there are many advantages to using the object directly.
The Palette command is a constructor for a new palette. The simplest usage is to just provide a list of colors.
When names are not specified for the colors in the palette, names will be created using the ColorDescription command.
The palette structure is primarily used to register new collections of colors using the AddPalette command.
As stand-alone objects, palettes recognize the indexing operator [] and can be indexed as if they were lists (using integer indices) or tables (using color name strings).
For all palettes except those of type dictionary, when indexed using a higher number than the number of colors specified in the definition, the palette will automatically be extended using the ExpandPalette command.
with⁡ColorTools:
grays≔Palette⁡seq⁡Color⁡`$`⁡i10,3,i=0..10
grays≔Palette:⁢Black⁢Dark Gray⁢Dark Gray 1⁢Dark Gray 2⁢Gray⁢Gray 1⁢Gray 2⁢Light Gray⁢Light Gray 1⁢Light Gray 2⁢White
grays2
〈RGB : Dark Gray〉
grays8..−2
〈RGB : Light Gray〉,〈RGB : Light Gray 1〉,〈RGB : Light Gray 2〉
grays
〈RGB : Black〉,〈RGB : Dark Gray〉,〈RGB : Dark Gray 1〉,〈RGB : Dark Gray 2〉,〈RGB : Gray〉,〈RGB : Gray 1〉,〈RGB : Gray 2〉,〈RGB : Light Gray〉,〈RGB : Light Gray 1〉,〈RGB : Light Gray 2〉,〈RGB : White〉
primary≔Palette⁡Red=Color⁡#f00,Blue=Color⁡#00f,Green=Color⁡#0f0,palettetype=fill
primary≔Palette:⁢Red⁢Blue⁢Green
primaryRed
〈RGB : Red〉
Swatches⁡primary,rows=1
Automatic transformations of colors may be done on non-dictionary palettes.
Lookup⁡primary,Red,shade=point
〈RGB : 0.726 0.00359 0〉
Non-dictionary palettes can be automatically expanded.
primary1..5
〈RGB : Red〉,〈RGB : Blue〉,〈RGB : Green〉,〈RGB : 0 0.00136 0.00529〉,〈RGB : 1 0 1〉
Palettes cannot be empty.
Palette⁡
Error, (in ColorTools:-Palette:-ModuleCopy) invalid input, a palette must be constructed with at least one color
The ColorTools[Palette] command was introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
See Also
ColorTools/ColorSpaces
ColorTools[AddPalette]
ColorTools[Color]
ColorTools[Palette][Lookup]
Download Help Document