mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Color: save a var statement.
This commit is contained in:
parent
da92ff9773
commit
30d2f16c8c
1 changed files with 3 additions and 4 deletions
|
@ -338,10 +338,9 @@ var Color = this.Color = Base.extend(new function() {
|
|||
return this.convert(colorType)[component];
|
||||
};
|
||||
this['set' + Base.capitalize(component)] = function(value) {
|
||||
// TODO: can this be optimized?
|
||||
var convertedColor = this.convert(colorType);
|
||||
convertedColor[component] = value;
|
||||
var color = convertedColor.convert(this._colorType);
|
||||
var color = this.convert(colorType);
|
||||
color[component] = value;
|
||||
color = color.convert(this._colorType);
|
||||
for (var i = 0, l = this._components.length; i < l; i++) {
|
||||
this[this._components[i]] = color[this._components[i]];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue