mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 13:52:06 -05:00
Fix accidentally reversed change and clean up code a bit.
This commit is contained in:
parent
f150552a9c
commit
6fc418b581
1 changed files with 4 additions and 3 deletions
|
@ -74,7 +74,6 @@ var Color = this.Color = Base.extend(new function() {
|
||||||
? new HSBColor(arg.hue, arg.saturation, arg.brightness,
|
? new HSBColor(arg.hue, arg.saturation, arg.brightness,
|
||||||
arg.alpha)
|
arg.alpha)
|
||||||
: new RGBColor(); // Fallback
|
: new RGBColor(); // Fallback
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Called on a subclass instance. Return the converted
|
// Called on a subclass instance. Return the converted
|
||||||
// color.
|
// color.
|
||||||
|
@ -91,7 +90,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
|
||||||
|
: 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
|
||||||
|
@ -113,7 +113,8 @@ var Color = this.Color = Base.extend(new function() {
|
||||||
// TODO: Is this correct?
|
// TODO: Is this correct?
|
||||||
// Shouldn't alpha be set to -1?
|
// Shouldn't alpha be set to -1?
|
||||||
: name === 'alpha' ? 1 : null;
|
: name === 'alpha' ? 1 : null;
|
||||||
}, this);
|
},
|
||||||
|
this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue