index.js
function getXYZ(color) {
    var r = toXYZValue(color[0]);
    var g = toXYZValue(color[1]);
    var b = toXYZValue(color[2]);

    return [
        r * 0.4124 + g * 0.3576 + b * 0.1805,
        r * 0.2126 + g * 0.7152 + b * 0.0722,
        r * 0.0193 + g * 0.1192 + b * 0.9505
    ]
}
function getXYZ(color) {
    var r = toXYZValue(color[0]);
    var g = toXYZValue(color[1]);
    var b = toXYZValue(color[2]);

    return [
        r * 0.4124 + g * 0.3576 + b * 0.1805,
        r * 0.2126 + g * 0.7152 + b * 0.0722,
        r * 0.0193 + g * 0.1192 + b * 0.9505
    ]
}
function getXYZ ( color ) { var r = toXYZValue ( color [ 0 ] ) ; var g = toXYZValue ( color [ 1 ] ) ; var b = toXYZValue ( color [ 2 ] ) ; return [ r * 0.4124 + g * 0.3576 + b * 0.1805 , r * 0.2126 + g * 0.7152 + b * 0.0722 , r * 0.0193 + g * 0.1192 + b * 0.9505 ] }
Returns XYZ representation of given color
@param  {Array} color  - RGBA color array [r,g,b,a]
@return {Array}        - [x,y,z] (x:0..95, y:0..100, z:0..108)
Returns XYZ representation of given color