Fix bug in Color#read.

This commit is contained in:
Jonathan Puckey 2011-05-15 14:11:35 +02:00
parent 1a82ef4a34
commit 2c36f3a62e
2 changed files with 7 additions and 1 deletions

View file

@ -91,7 +91,8 @@ var Color = this.Color = Base.extend(new function() {
? rgbColor.convert(this._colorType)
: rgbColor;
} else {
var components = isArray ? arg : arguments;
var components = isArray ? arg
: arguments;//Array.prototype.slice.call(arguments);
if (!this._colorType) {
// Called on the abstract Color class. Guess color type
// from arg

View file

@ -153,4 +153,9 @@ test('Setting HSBColor#gray', function() {
var color = new HSBColor(180, 0, 0);
color.gray = 0.5;
compareHSBColors(color, [0, 0, 0.5, 1]);
});
test('Color.read(channels)', function() {
var color = Color.read([0, 0, 1]);
compareRGBColors(color, [0, 0, 1, 1]);
});