Learn R Programming

webmorphR (version 0.1.1)

col2lab: Color to Lab Conversion

Description

R color to Lab colourspace conversion. Calculated with Observer. = 2<U+00B0>, 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<U+00B0>, 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

Run this code
# NOT RUN {
col2lab("red")
col2lab("#FF0000")

# }

Run the code above in your browser using DataLab