A function which accepts a vector of numeric values and returns interpolated colors.
Arguments
breaks
A vector of numeric break values.
colors
A vector of colors which correspond to values in breaks.
transparency
A single value in [0, 1]. 0 refers to no transparency and 1 refers to full transparency.
space
Color space in which colors are interpolated. Value should be one of "RGB", "LAB", "XYZ", "sRGB", "LUV", see color-class for details.
hcl_palette
Name of the HCL palette. Value should be supported in hcl.pals.
reverse
Whether should the colors in hcl_palette be reversed.
Details
Colors are linearly interpolated according to the break values and corresponding colors through a certain color space.
Values exceeding breaks will be assigned with corresponding maximum or minimum colors.
See Also
col2value converts back to the original values by providing the color mapping function generated by colorRamp2.