This function returns a set of colours interpolating between the specified
key colours, equally separated in the specified space.
Usage
gradient(shades, steps = NULL, space = NULL)
Arguments
shades
Two or more colours, in any suitable form (see
shade), or a named colour map such as "viridis".
steps
An integer giving the number of shades required in the palette.
If NULL, a function will instead be returned that takes this
argument.
space
The colour space to traverse. Defaults to the current space of
shades, or "Lab" for the matplotlib colour maps, or
"sRGB" otherwise.
Value
A character vector of class "shade" containing the gradient
elements in the specified space, or a palette function.
Details
The key colours may be specified explicitly, or else a built-in colour map
may be used. The maps available are currently those developed for Python's
matplotlib 2.0, namely "magma", "inferno",
"plasma" and "viridis", and certain ColorBrewer palettes,
namely "Blues", "Reds", "YlOrRd" (yellow-orange-red)
and "RdBu" (red-grey-blue, a balanced diverging scale).