View source: R/helper_functions.R
rgba_to_rgb | R Documentation |
Converts RGBA to RGB (helper function)
rgba_to_rgb(colour_rgba, background_colour = "#ffffff", ...)
colour_rgba |
A vector of length 4: c(red value, green value, blue value, alpha). All colour values must be between 0 and 255. Alpha must be between 0 and 1. |
background_colour |
Defaults to white. Users can specify a different colour to get
the hex code for their original colour blended with a specified background colour.
|
... |
Allows for US spelling of color/colour. |
A matrix of red, green and blue values
rgba_to_rgb(c(52, 46, 39, 0.8))
rgba_to_rgb(c(52, 46, 39, 0.8), "blue")
rgba_to_rgb(c(52, 46, 39, 0.8), "#032cfc")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.