RGB Color Specification
This function creates colors corresponding to the given
intensities (between 0 and
max) of the red, green and blue
primaries. The colour specification refers to the
standard sRGB colorspace (IEC standard 61966).
An alpha transparency value can also be specified (as an opacity, so
0 means fully transparent and
max means opaque). If
alpha is not specified, an opaque colour is generated.
names argument may be used to provide names for the
The values returned by these functions can be used with a
col= specification in graphics functions or in
numeric vectors with values in [0, M]
where M is
character vector. The names for the resulting vector.
number giving the maximum of the color values range, see above.
The colors may be specified by passing a matrix or data frame as argument
red, and leaving
In this case the first three columns of
red are taken to be
Semi-transparent colors (
0 < alpha < 1) are supported only on
some devices: at the time of writing on the
X11(type = "cairo") devices and
associated bitmap devices (
bitmap). They are supported by several
third-party devices such as those in packages \CRANpkgCairo,
\CRANpkgcairoDevice and \CRANpkgJavaGD. Only some of these
devices support semi-transparent backgrounds.
Most other graphics devices plot semi-transparent colors as fully transparent, usually with a warning when first encountered.
NA values are not allowed for any of
A character vector with elements of 7 or 9 characters,
followed by the red, blue, green and optionally alpha values in
hexadecimal (after rescaling to
0 ... 255). The optional alpha
values range from
0 (fully transparent) to
R does not use ‘premultiplied alpha’.
col2rgb for translating R colors to RGB vectors;
1 2 3 4 5 6 7 8