color-class {colorspace} | R Documentation |
Class "color"
Description
Objects from the class color represent colors in a number of color spaces. In particular, there are subclasses of color which correspond to RGB, HSV, HLS, CIEXYZ, CIELUV, CIELAB and polar versions of the last two spaces.
Objects from the Class
Objects can be created by calls to the
functions RGB
, sRGB
, HSV
, HLS
, XYZ
,
LUV
, LAB
, polarLUV
, and polarLAB
. These are all
subclasses of the virtual class color.
Slots
coords
:An object of class
"matrix"
.
Methods
- [
signature(x = "color")
: This method makes it possible to take subsets of a vector of colors.- coerce
signature(from = "color", to = "RGB")
: convert a color vector to RGB.- coerce
signature(from = "color", to = "sRGB")
: convert a color vector to sRGB.- coerce
signature(from = "color", to = "XYZ")
: convert a color vector to XYZ.- coerce
signature(from = "color", to = "LAB")
: convert a color vector to LAB.- coerce
signature(from = "color", to = "polarLAB")
: convert a color vector to polarLAB.- coerce
signature(from = "color", to = "HSV")
: convert a color vector to HSV.- coerce
signature(from = "color", to = "HLS")
: convert a color vector to HLS.- coerce
signature(from = "color", to = "LUV")
: convert a color vector to LUV.- coerce
signature(from = "color", to = "polarLUV")
: convert a color vector to polarLUV.- coords
signature(color = "color")
: extract the color coordinates from a color vector.- plot
signature(x = "color")
: plot a color vector- show
signature(object = "color")
: show a color vector.
Author(s)
Ross Ihaka
See Also
RGB
, XYZ
, HSV
,
HLS
, LAB
, polarLAB
,
LUV
, polarLUV
, mixcolor
.
Examples
x <- sRGB(runif(1000), runif(1000), runif(1000))
plot(as(x, "LUV"))