warp {shades} | R Documentation |
Shift colours between spaces
Description
This function shifts the current colour space of its arguments to the
specified space, returning a new object of class "shade"
.
Usage
warp(x, space)
Arguments
x |
An R object which can be coerced to class |
space |
A string naming the new space. |
Details
Valid names for spaces are currently those supported by the
convertColor
function, namely “sRGB”, “Apple RGB”, “CIE
RGB”, “XYZ”, “Lab” and “Luv”; plus “RGB” (which is treated as an
alias for “sRGB”), “HSV”, “LCh” and “LMS”. Case is not significant.
Value
A new object of class "shade"
.
Note
LMS space, used for chromatic adaptation and simulating colour blindness, is not uniquely defined. Here we use the (linearised) Bradford transform, obtained by Lam (1985) and used widely in ICC colour profiles and elsewhere, to transform to and from CIE XYZ space.
R uses the D65 standard illuminant as the reference white for the “Lab” and “Luv” spaces.
Author(s)
Jon Clayden <code@clayden.org>
References
Lam, K.M. (1985). Metamerism and colour constancy. PhD thesis, University of Bradford.
See Also
Examples
warp("red", "HSV")