index.js
function getLab(color) {
    var xyz = getXYZ(color);

    var white = [ 95.047, 100.000, 108.883 ]; //for X, Y, Z

    var x = fromXYZValueToLabValue(xyz[0], white[0]);
    var y = fromXYZValueToLabValue(xyz[1], white[1]);
    var z = fromXYZValueToLabValue(xyz[2], white[2]);

    return [
        116 * y - 16,
        500 * (x - y),
        200 * (y - z)
    ]
}
function getLab(color) {
    var xyz = getXYZ(color);

    var white = [ 95.047, 100.000, 108.883 ]; //for X, Y, Z

    var x = fromXYZValueToLabValue(xyz[0], white[0]);
    var y = fromXYZValueToLabValue(xyz[1], white[1]);
    var z = fromXYZValueToLabValue(xyz[2], white[2]);

    return [
        116 * y - 16,
        500 * (x - y),
        200 * (y - z)
    ]
}
function getLab ( color ) { var xyz = getXYZ ( color ) ; var white = [ 95.047 , 100.000 , 108.883 ] ; //for X, Y, Z var x = fromXYZValueToLabValue ( xyz [ 0 ] , white [ 0 ] ) ; var y = fromXYZValueToLabValue ( xyz [ 1 ] , white [ 1 ] ) ; var z = fromXYZValueToLabValue ( xyz [ 2 ] , white [ 2 ] ) ; return [ 116 * y - 16 , 500 * ( x - y ) , 200 * ( y - z ) ] }
Returns LAB color components
@param  {Array} color - RGBA color array [r,g,b,a]
@return {Array}       - LAB values array [l,a,b] (l:0..100, a:-128..127, b:-128..127)
Returns LAB color components