RGB {colorspace}R Documentation

Create RGB Colors

Description

This function creates colors of class RGB; a subclass of the virtual ``color'' class.

Usage

RGB(R, G, B, names = NULL)

Arguments

R,G,B these arguments give the red, green and blue intensities of the colors (the values should lie between 0 and 1). The values can be provided in separate R, G and B vectors or in a three-column matrix passed as R.
names The (optional) names to be given to the colors.

Details

This function creates colors in the standard sRGB color space (IEC standard 61966).

Value

An object of class ``RGB'' which inherits from class ``color.''

Author(s)

Ross Ihaka

References

www.srgb.com

See Also

HSV, XYZ, LAB, polarLAB, LUV, polarLUV.

Examples

# Create a random set of colors
rgb = RGB(R = runif(20), G = runif(20), B = runif(20))

[Package Contents]