Add transparency to colours
Usage
add_alpha(col, alpha = 1)
Arguments
- col
A vector of colours.
- alpha
numeric in (0,1]
, the transparency wanted.
Value
a vector of colours with added transparency
Examples
add_alpha(col = c("blue", rgb(100,20,30, max = 255), '#0A461E', viridis::viridis(1)),
alpha = 0.5)
#> blue #64141E #0A461E #440154FF
#> "#0000FF80" "#64141E80" "#0A461E80" "#44015480"