marine.colours {albatross} | R Documentation |
Perceptually uniform palettes
Description
Create perceptually continuous palettes of R colours.
Usage
marine.colours(
n, chroma = 0.65, luminance = c(0.35, 1),
alpha = 1, gamma = 1, fixup = TRUE
)
diverging.colours(
n, chroma = c(.1, .75), luminance = c(1, .35),
alpha = 1, gamma = 1, fixup = TRUE
)
Arguments
n |
Number of colours to return. |
chroma |
Specifies the chroma (how saturated should the colours be) for the
palette, a real number between |
luminance |
Specifies the luminance (how bright should the colours be) of the
colours constituting the palette. Typically, a two-element vector
of real numbers between |
alpha |
Specifies the transparency of the colours of the palette. As above,
can be a fixed number or a two-element vector in the range
|
gamma |
Provides the power coefficient for the hue/chroma/luminance/alpha
growth formulae. May be useful when it is needed to sacrifice the
perceptual linearity of the palette to provide more contrast for
smaller or bigger values on the plot. The gamma-corrected values
are obtained by computing
|
fixup |
Whether to correct the palette if the resulting colours happen to
fall outside the valid RGB range (passed as-is to |
Details
The marine.colours
palette is used by default by all
plot
methods (e.g. plot.feem
) for FEEM-like data
to show absolute values. It is designed to retain perceptual
uniformity even after complete desaturation.
The diverging.colours
palette is used by
plot.feem.resid
to display residual values. People with
severe colour vision deficiency (tritanopia or monochromacy) won't be
able to discern positive and negative branches of the palette, but
it's supposed to be legible for people with deuteranopia and
protanopia.
Value
A character vector of length n
containing colour specifications
for use with R graphics functions.
The marine.colours
palette at the default values of
C_{uv}^* = 0.65
, L^* \in [0.35; 1]
, \alpha = \gamma = 1
.
The diverging.colours
palette at the default values of
C_{uv}^* \in [0.1; 0.75]
, L^* \in [0.35;
1]
,
\alpha = \gamma = 1
.
References
Insired by cmocean palette called “haline” (https://matplotlib.org/cmocean/#haline), but using R's implementation of polar CIE-LUV colour space instead of CAM02-UCS.
CUBEHELIX (https://people.phy.cam.ac.uk/dag9/CUBEHELIX/) is a similar technique using BT.601 luminance coefficients and RGB colour space.
See Also
Examples
image(volcano, col = marine.colours(256))