Description Usage Arguments Details Value Examples
View source: R/adjustcolorHSV.R
Adjust or modify a vector of colors by "turning knobs" on one or more coordinates in (h,s,v,α) space, typically by up or down scaling them.
1 2 3 |
col |
vector of colors, in any format that col2rgb() accepts |
alpha.f, h.f, s.f, v.f |
factors scaling the opacity, hue, saturation
and value of |
offset |
a length 4 numeric vector specifying the linear offset applied to the hue, saturation, value and alpha values |
transform |
a 4x4 diagonal matrix specifying the scaling applied to the hue, saturation, value and alpha values |
h, s, v, alpha |
fixed vlues for hue, saturation, value and alpha. Overrides any corresponding scaling factor or offset |
Essentially an HSV version of the RGB-based adjustcolor
. One
important distinction is that the h.f
value wraps around to fit the [0, 1]
range, rather than simply "clamping" it between 0 and 1.
A character vector the same length as col
contaning color data in standard
hexadeximal RGBA format.
1 2 3 4 5 6 7 | # Halve the saturation and value of the default palette colours
plot(2:8, cex=5, lwd=4, pch=21, bg=2:8,
col=adjustcolorHSV(2:8, s.f=0.5, v.f=0.6))
# Offset the hue of the default palette colours by 0.5, inverting the colours
plot(2:8, cex=5, lwd=4, pch=21, bg=2:8,
col=adjustcolorHSV(2:8, offset=c(0.5, 0, 0, 0)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.