Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

toPolar

Convert CIE Lab and Luv to Polar Form


Description

Convert the Rectangular Form of CIE Lab and Luv to Polar Form

Usage

LCHabfromLab( Lab ) 
LCHuvfromLuv( Luv )

Arguments

Lab

a numeric Nx3 matrix with CIE Lab coordinates in the rows, or a vector that can be converted to such a matrix, by row.

Luv

a numeric Nx3 matrix with CIE Luv coordinates in the rows, or a vector that can be converted to such a matrix, by row.

Value

a numeric Nx3 matrix with LCH coordinates in the rows. The lightness L is simply copied from input to output. The chroma C corresponds to radius in polar coordinates, and the hue H corresponds to theta. H is in degrees, not radians. The rownames are copied from input to output.

References

Wikipedia. CIE 1931 color space. https://en.wikipedia.org/wiki/CIE_1931_color_space

See Also

Examples

LCHabfromLab( c(50,0,0) )   #  a neutral gray
##        L Cab Hab
##  [1,] 50   0   0         # Hue is undefined, but set to 0

LCHabfromLab( c(50,0,20) ) 
##        L Cab Hab
##  [1,] 50  20  90         # 90 degrees, on yellow axis


LCHabfromLab( c(50,0,-20) ) 
##        L Cab Hab
##  [1,] 50  20 270         # 270 degrees, on blue axis

spacesXYZ

CIE XYZ and some of Its Derived Color Spaces

v1.1-1
GPL (>= 3)
Authors
Glenn Davis [aut,cre]
Initial release
2020-03-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.