index.js
function setXYZ(color, x, y, z) {
    var r = x *  3.2406 + y * -1.5372 + z * -0.4986;
    var g = x * -0.9689 + y *  1.8758 + z *  0.0415;
    var b = x *  0.0557 + y * -0.2040 + z *  1.0570;

    color[0] = fromXYZValue(r);
    color[1] = fromXYZValue(g);
    color[2] = fromXYZValue(b);
    color[3] = 1.0;

    return color;
}
function setXYZ(color, x, y, z) {
    var r = x *  3.2406 + y * -1.5372 + z * -0.4986;
    var g = x * -0.9689 + y *  1.8758 + z *  0.0415;
    var b = x *  0.0557 + y * -0.2040 + z *  1.0570;

    color[0] = fromXYZValue(r);
    color[1] = fromXYZValue(g);
    color[2] = fromXYZValue(b);
    color[3] = 1.0;

    return color;
}
function setXYZ ( color , x , y , z ) { var r = x * 3.2406 + y * - 1.5372 + z * - 0.4986 ; var g = x * - 0.9689 + y * 1.8758 + z * 0.0415 ; var b = x * 0.0557 + y * - 0.2040 + z * 1.0570 ; color [ 0 ] = fromXYZValue ( r ) ; color [ 1 ] = fromXYZValue ( g ) ; color [ 2 ] = fromXYZValue ( b ) ; color [ 3 ] = 1.0 ; return color ; }
Updates a color based on x, y, z component values
@param  {Array} color   - RGBA color array [r,g,b,a] to update
@param  {Number} x - x component (0..95)
@param  {Number} y - y component (0..100)
@param  {Number} z - z component (0..108)
@return {Array} - updated RGBA color array [r,g,b,a] (0..1)
Updates a color based on x y z component values