Return the alpha transparency per R color
Arguments
- x
characterR compatible color, either a color name, hex value, or a mixture of the two. Any value compatible withgrDevices::col2rgb().- maxValue
numericmaximum value to return, useful when the downstream alpha range should be 255. By default maxValue=1 is returned.- ...
Additional arguments are ignored.
See also
Other jam color functions:
alpha2col(),
applyCLrange(),
col2hcl(),
col2hsl(),
col2hsv(),
color2gradient(),
fixYellow(),
fixYellowHue(),
getColorRamp(),
hcl2col(),
hsl2col(),
hsv2col(),
isColor(),
kable_coloring(),
makeColorDarker(),
rainbow2(),
rgb2col(),
setCLranges(),
setTextContrastColor(),
showColors(),
unalpha(),
warpRamp()
Examples
col2alpha(c("red", "#99004499", "beige", "transparent", "#FFFFFF00"))
#> [1] 1.0 0.6 1.0 0.0 0.0