sRGB: Create sRGB Colors

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/colorspace.R

Description

This function creates colors of class sRGB; a subclass of the virtual “color” class.

Usage

1
sRGB(R, G, B, names)

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

A vector of names for the colors (by default the row names of R are used).

Details

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

Value

An object of class “sRGB” which inherits from class “color.”

Author(s)

Ross Ihaka

References

www.srgb.com

See Also

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

Examples

1
2
3
# Create a random set of colors
set.seed(1)
sRGB(R = runif(20), G = runif(20), B = runif(20))


colorspace documentation built on May 19, 2017, 7:02 p.m.
Search within the colorspace package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.