Skip to contents

R color to Lab colourspace conversion. Calculated with Observer. = 2°, Illuminant = D65.

Usage

col2lab(col, ref_X = 95.047, ref_Y = 100, ref_Z = 108.883)

Arguments

col

vector of hex or color names

ref_X, ref_Y, ref_Z

Reference values for Observer= 2°, Illuminant= D65

Value

vector of L, a and b values

Details

The formulas used to convert from RGB to XYZ and XYZ to Lab are from http://www.easyrgb.com/en/math.php and the reference values are from http://www.brucelindbloom.com/index.html?ColorCheckerCalcHelp.html

See also

Other color: color_conv(), lab2rgb()

Examples

col2lab("red")
#>        L        a        b 
#> 53.23288 80.10931 67.22007 
col2lab("#FF0000")
#>        L        a        b 
#> 53.23288 80.10931 67.22007