clr_rotate | R Documentation |
Rotate the colors around the hue wheel
clr_rotate(col, degrees = 0)
col |
a color object or vector of any of the three kinds of R color specifications, i.e., either a color name (as listed by colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa" (see rgb), or a positive integer i meaning palette()[i]. |
degrees |
Numeric between 0 and 360, denoting the amount of degrees the colors should be rotated. Defaults to 0. |
The colors will be transformed to HCL color space (Hue-Chroma-Luminance) where the hue of the color will be rotation.
a colors object of same length as col.
https://en.wikipedia.org/wiki/HCL_color_space
plot(clr_rotate(terrain.colors(10)))
plot(clr_rotate(terrain.colors(10), degrees = 90))
plot(clr_rotate(terrain.colors(10), degrees = 180))
plot(clr_rotate(rep("magenta", 11), degrees = seq(0, 360, length.out = 11)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.