index.js
function setLab(color, l, a, b) {
    var white = [ 95.047, 100.000, 108.883 ]; //for X, Y, Z

    var y = (l + 16) / 116;
    var x = a / 500 + y;
    var z = y - b / 200;

    x = fromLabValueToXYZValue(x, white[0]);
    y = fromLabValueToXYZValue(y, white[1]);
    z = fromLabValueToXYZValue(z, white[2]);

    return setXYZ(color, x, y, z);
}
function setLab(color, l, a, b) {
    var white = [ 95.047, 100.000, 108.883 ]; //for X, Y, Z

    var y = (l + 16) / 116;
    var x = a / 500 + y;
    var z = y - b / 200;

    x = fromLabValueToXYZValue(x, white[0]);
    y = fromLabValueToXYZValue(y, white[1]);
    z = fromLabValueToXYZValue(z, white[2]);

    return setXYZ(color, x, y, z);
}
function setLab ( color , l , a , b ) { var white = [ 95.047 , 100.000 , 108.883 ] ; //for X, Y, Z var y = ( l + 16 ) / 116 ; var x = a / 500 + y ; var z = y - b / 200 ; x = fromLabValueToXYZValue ( x , white [ 0 ] ) ; y = fromLabValueToXYZValue ( y , white [ 1 ] ) ; z = fromLabValueToXYZValue ( z , white [ 2 ] ) ; return setXYZ ( color , x , y , z ) ; }
Updates a color based on l, a, b, component values
@param  {Array} color   - RGBA color array [r,g,b,a] to update
@param  {Number} l - l component (0..100)
@param  {Number} a - a component (-128..127)
@param  {Number} b - b component (-128..127)
@return {Array} - updated RGBA color array [r,g,b,a] (0..1)
Updates a color based on l a b component values