| rgb2hex | R Documentation |
Convert an RGB triplet (or a list of triplets) to HEX color codes.
rgb2hex(rgb)
rgb |
A numeric vector of length 3 (e.g., |
A HEX color string if a single RGB vector is provided, or a character vector of HEX codes if a list is provided.
rgb2hex(c(255, 128, 0)) # "#FF8000"
rgb2hex(list(c(255,128,0), c(0,255,0))) # c("#FF8000", "#00FF00")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.