Description Usage Arguments Details Value
as.rgb()
converts a value in the HSL (hue-saturation-lightness)
color model or a hexadecimal code for a value in the RGB (red-green-blue)
color model to a value in the RGB color model.
1 | as.rgb(x)
|
x |
A character string or a numeric vector with 3 elements. A character string is assumed to be the hexadecimal code for a value in the RGB color model; a numeric vector is assumed to be a value in the HSL color model. |
If x
is a character string, then it is assumed that x
is
a hexadecimal code ('#RRGGBB'
) whose substrings denote the the values
of the red ('RR'
), green ('GG'
), and blue ('BB'
) beams.
If x
is a numeric vector (but not an integer vector), then it is
assumed that x
denotes a value in the HSL color model—i.e.,
that the first element of x
is an whole number between 0 and 359,
denoting the angle of the hue on the color wheel;
that the second element is a floating point number (to 2 decimal places)
between 0 and 1, denoting the saturation proportion;
that the third element is a floating point number (to 2 decimal places)
between 0 and 1, denoting the lightness proportion.
An integer vector with three elements (valued between 0 and 255) that denote the values of the red, green, and blue beams, respectively.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.