swatch: Simple colour swatches

swatchR Documentation

Simple colour swatches

Description

This function provides a simple visualisation of a colour series as a series of boxes against the specified background colour. If the input has more than one dimension then the boxes will be arranged in a grid (flattening further dimensions after the second).

Usage

swatch(x, bg = "white", border = "grey50", cex = 0.7, font = 2, ...)

Arguments

x

One or more colours, in any suitable form (see shade()).

bg

A background colour.

border

The border colour to draw around each box.

cex

The font size to use for labelling named shades.

font

The font weight to use for labelling named shades, in the sense of par(). The default, 2, corresponds to boldface.

...

Additional arguments (currently unused).

Author(s)

Jon Clayden code@clayden.org

See Also

par()

Examples

swatch(c("red", "green", "blue"))

shades documentation built on July 3, 2026, 1:07 a.m.