ColToHex | R Documentation |
Convert a color given by name, by its palette index or by rgb-values into a string of the form "#rrggbb" or "#rrggbbaa".
ColToHex(col, alpha = 1)
col |
vector of any of either a color name (an element of colors()), or an integer i meaning palette()[i]. Non-string values are coerced to integer. |
alpha |
the alpha value to be used. This can be any value from 0 (fully transparent) to 1 (opaque). Default is 1. |
Returns the colorvalue in #rrggbb" or #rrggbbaa" format. (character)
Andri Signorell <andri@signorell.net>
HexToCol, ColToRgb, colors
ColToHex(c("lightblue", "salmon"))
x <- ColToRgb("darkmagenta")
x[2,] <- x[2,] + 155
RgbToCol(x)
RgbToHex(c(255,0,0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.