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 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.
coords
:An object of class "matrix"
.
signature(x = "color")
: This method makes it possible to
take subsets of a vector of colors.
signature(from = "color", to = "RGB")
: convert
a color vector to RGB.
signature(from = "color", to = "sRGB")
: convert
a color vector to sRGB.
signature(from = "color", to = "XYZ")
: convert
a color vector to XYZ.
signature(from = "color", to = "LAB")
: convert
a color vector to LAB.
signature(from = "color", to = "polarLAB")
: convert
a color vector to polarLAB.
signature(from = "color", to = "HSV")
: convert
a color vector to HSV.
signature(from = "color", to = "HLS")
: convert
a color vector to HLS.
signature(from = "color", to = "LUV")
: convert
a color vector to LUV.
signature(from = "color", to = "polarLUV")
: convert
a color vector to polarLUV.
signature(color = "color")
: extract the color
coordinates from a color vector.
signature(x = "color")
: plot a color vector
signature(object = "color")
: show a color vector.
Ross Ihaka
RGB
, XYZ
, HSV
,
HLS
, LAB
, polarLAB
,
LUV
, polarLUV
, mixcolor
.
x <- sRGB(runif(1000), runif(1000), runif(1000))
plot(as(x, "LUV"))
Run the code above in your browser using DataLab