ColorTools
Swatches
plot squares of color
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Swatches(colors, opts)
colors
-
list of colors in formats recognized by ColorTools or a Palette object or name
opts
(optional) equation(s) of the form option=value where option is one of rows, gap, borders, mode, filter, bottomup or any valid option for 2-D plots; see plot/options
rows= positive integer
The number of rows in which to lay out the colors
gap= constant between 0 and 1
The distance between color squares
borders=list
A list of the two colors to use for the backgrounds of the plot if either color is give as an empty list or FAIL then the corresponding background will be omitted from the plot. If borders=[] then both backgrounds will be omitted.
bottomup=true or false
If true, the first color in the palette will appear in the bottom left corner instead of the top left.
filter=procedure
A procedure to apply to every color before rendering
mode=name (one of the following)
Shortcuts to set a number of options for a specific effect.
mode=compact creates a small plot with no borders or gaps
mode=gradient creates a single thin row with no borders or gaps
mode=wheel creates a gradient as an annulus
The Swatches command creates a plot of squares of the input colors. The colors are laid out into a grid that is as close to square as possible by default. This can be overridden with the rows option.
with⁡ColorTools:
Swatches⁡Red,Green,Blue,Yellow
Swatches⁡Red,Green,Blue,Yellow,rows=1,gap=0.,borders=White,White
Palette objects can be passed in directly
Swatches⁡GetPalette⁡Executive
Known palettes can be passed in by name
Swatches⁡X11,mode=compact
The filter option is good for checking a palette's properties when viewed by a user with CVD or viewed in grayscale
Swatches⁡Turbo,mode=gradient,filter=CVDSimulation
Swatches⁡Magma,mode=gradient,`=`⁡filter,c↦Color⁡Gs,c
The ColorTools:-Swatches command was introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
The bottomup option was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
The ColorTools:-Swatches command was updated in Maple 2023.
The filter and mode options were introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
ColorTools/ColorSpaces
ColorTools[Color]
Download Help Document