This function returns a color value for each row of the 2-column dataset supplied, based on a 2D color palette defined by a center color and a series of peripheral colors.
Usage
colorwheel2d(
data,
colors = c("black", "yellow", "green", "cyan", "blue", "magenta", "red"),
origin = NULL,
xyratio = NULL,
kernel = NULL
)
Arguments
- data
Matrix or data frame with 2 numeric columns; they will map to x and y.
- colors
Vector of colors to interpolate: center followed by periphery counterclockwise from 3 o'clock.
- origin
Coordindates of color wheel center.
- xyratio
Scalar representing how to map the elliptical color wheel in the data space (the default 1 a circular mapping that weights the two dimensions equally).
- kernel
Optional function describing the shape of radial color gradients (default is a linear mapping corresponding to a triangular kernel); this function should take a vector of distances to the center as its sole input and return a positive number.