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

Online Help

All Products    Maple    MapleSim


ColorTools

  

Swatches

  

plot squares of color

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Swatches(colors, opts)

Parameters

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

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

Description

• 

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.

Examples

withColorTools:

SwatchesRed,Green,Blue,Yellow

SwatchesRed,Green,Blue,Yellow,rows=1,gap=0.,borders=White,White

Palette objects can be passed in directly

SwatchesGetPaletteExecutive

Known palettes can be passed in by name

SwatchesX11,mode=compact

The filter option is good for checking a palette's properties when viewed by a user with CVD or viewed in grayscale

SwatchesTurbo,mode=gradient,filter=CVDSimulation

SwatchesMagma,mode=gradient,`=`filter,cColorGs,c

Compatibility

• 

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

ColorTools/ColorSpaces

ColorTools[Color]