alphacol
adds an alpha value to a colour specification and convert to
a hexadecimal colour string.
alphacol(col, alpha = FALSE)
col | vector of any of the three kinds of R color specifications,
i.e., either a color name (as listed by |
---|---|
alpha | logical value indicating whether the alpha channel (opacity) values should be returned. |
# Alphas alphacol('red') # do nothing#> [1] "#ff0000"alphacol('red', 10)#> [1] "#ff0000a"alphacol('#aabbcc', 5)#> [1] "#aabbcc5"alphacol(4, 5)#> [1] "#2297e65"