
Create a calibrated color ramp object from color-tiepoint data.frames
Source:R/calibramp.R
expand.Rd
Create ramp palettes from fixed color positions.
Arguments
- x
A
data.frame
object with two columns:color
for hexadecimal color values,z
for their position.- n
A single
integer
number.- color
A
chraracter
value, the column name of the colors inx
, defaults to"color"
. Alternatively, acharacter
vector of hexadecimal color values, with the same length asz
.- z
A
character
value, the column name of the values inx
, defaults to"z"
. Alternatively, anumeric
vector of color values (must have the same length ascolor
.- ...
Arguments passed to the
colorRampPalette
function.
Details
The function creates objects of the S3 class calibramp
. The calibramp
-class lists have three elements: col
hexadecimal color values, mid
: z-values of midpoints (one for every color), and breaks
: separator borders between color values.
Color interpolation will be executed linearly, using colorRampPalette
, the order of the values will be forced to ascending, the values in mid
will be halfway between breaks.