mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix bug in Color#read.
This commit is contained in:
parent
1a82ef4a34
commit
2c36f3a62e
2 changed files with 7 additions and 1 deletions
|
@ -91,7 +91,8 @@ var Color = this.Color = Base.extend(new function() {
|
||||||
? rgbColor.convert(this._colorType)
|
? rgbColor.convert(this._colorType)
|
||||||
: rgbColor;
|
: rgbColor;
|
||||||
} else {
|
} else {
|
||||||
var components = isArray ? arg : arguments;
|
var components = isArray ? arg
|
||||||
|
: arguments;//Array.prototype.slice.call(arguments);
|
||||||
if (!this._colorType) {
|
if (!this._colorType) {
|
||||||
// Called on the abstract Color class. Guess color type
|
// Called on the abstract Color class. Guess color type
|
||||||
// from arg
|
// from arg
|
||||||
|
|
|
@ -153,4 +153,9 @@ test('Setting HSBColor#gray', function() {
|
||||||
var color = new HSBColor(180, 0, 0);
|
var color = new HSBColor(180, 0, 0);
|
||||||
color.gray = 0.5;
|
color.gray = 0.5;
|
||||||
compareHSBColors(color, [0, 0, 0.5, 1]);
|
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]);
|
||||||
});
|
});
|
Loading…
Reference in a new issue