fromXYZ | R Documentation |
Convert from XYZ to other Color Spaces
xyYfromXYZ( XYZ )
LabfromXYZ( XYZ, white )
LuvfromXYZ( XYZ, white )
XYZ |
a numeric Nx3 matrix with CIE XYZ coordinates in the rows, or a vector that can be converted to such a matrix, by row. |
white |
a numeric 3-vector giving the XYZ of reference white; all 3 numbers must be positive.
|
xyYfromXYZ() |
returns a numeric Nx3 matrix with CIE xyY coordinates in the rows.
If the sum |
LabfromXYZ() |
returns a numeric Nx3 matrix with CIE Lab coordinates in the rows |
LuvfromXYZ() |
returns a numeric Nx3 matrix with CIE Luv coordinates in the rows |
In all cases, the rownames are copied from input to output.
If the input is invalid, the functions return NULL
.
Wikipedia. CIE 1931 color space. https://en.wikipedia.org/wiki/CIE_1931_color_space
standardXYZ()
D65 = standardXYZ( 'D65' )
xyYfromXYZ( D65 )
## x y Y
## D65 0.3127266 0.3290231 1 # probably not familiar
round( xyYfromXYZ(D65), 4 )
## x y Y
## D65 0.3127 0.329 1 # probably more familiar
LabfromXYZ( 0.18*D65, D65 ) # 18% gray card
## L a b
## D65 49.49611 0 0 # exactly neutral, and L is about 50
D50 = standardXYZ( 'D50' )
LabfromXYZ( D50, D65 )
## L a b
## D50 100 2.399554 17.65321 # D50 is far from neutral (yellowish) in D65 viewing environment
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.