# convert character string representing a color to RGB-code
# using alpha-channel of .25 (75\% transparent)
as_rgb("red", alpha=.25)
# same thing now using the RGB-code of red (alpha=1, i.e. as_rgb("red"))
as_rgb("#FF0000FF", alpha=.25)
Run the code above in your browser using DataLab