Convert R color to HSV matrix
Details
This function takes a valid R color and converts to a HSV matrix. The
output can be effectively returned to R color with
hsv2col, usually after manipulating the
HSV color matrix.
See also
Other jam color functions:
alpha2col(),
applyCLrange(),
col2alpha(),
col2hcl(),
col2hsl(),
color2gradient(),
fixYellow(),
fixYellowHue(),
getColorRamp(),
hcl2col(),
hsl2col(),
hsv2col(),
isColor(),
kable_coloring(),
makeColorDarker(),
rainbow2(),
rgb2col(),
setCLranges(),
setTextContrastColor(),
showColors(),
unalpha(),
warpRamp()
Examples
# start with a color vector
# red and blue with partial transparency
colorV <- c("#FF000055", "#00339999");
# confirm the hsv matrix maintains transparency
col2hsv(colorV);
#> [,1] [,2]
#> h 0.0000000 0.6111111
#> s 1.0000000 1.0000000
#> v 1.0000000 0.6000000
#> alpha 0.3333333 0.6000000
# convert back to the original color
hsv2col(col2hsv(colorV));
#> [1] "#FF000055" "#00339999"