Color initialization with type 'hex' failes. Probably because the code
converts twice in this case. I've written a JSSpec test that shows the
failure:
describe('Color initialize with type', {
'Should initialize a color from a hex value': function () {
var color = new Color('0A0B0C', 'hex');
value_of(color.hex).should_be('#0a0b0c');
},
'Should initialize a color from a RGB array': function () {
var color = new Color([10, 11, 12], 'rgb');
value_of(color.rgb).should_be([10, 11, 12]);
value_of(color.hsb).should_be([210, 17, 5]);
},
'Should initialize a color from a HSB array': function () {
var color = new Color([210, 17, 5], 'hsb');
value_of(color.hsb).should_be([210, 17, 5]);
}
});