mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Shorten some converters a bit.
This commit is contained in:
parent
9b95ba095c
commit
dfc6a05969
1 changed files with 3 additions and 4 deletions
|
@ -118,13 +118,12 @@ var Color = this.Color = Base.extend(new function() {
|
|||
},
|
||||
|
||||
'gray-rgb': function(color) {
|
||||
var component = 1 - color.getGray();
|
||||
return new RGBColor(component, component, component, color._alpha);
|
||||
var comp = 1 - color.getGray();
|
||||
return new RGBColor(comp, comp, comp, color._alpha);
|
||||
},
|
||||
|
||||
'hsb-gray': function(color) {
|
||||
var rgbColor = converters['hsb-rgb'](color);
|
||||
return converters['rgb-gray'](rgbColor);
|
||||
return converters['rgb-gray'](converters['hsb-rgb'](color));
|
||||
},
|
||||
|
||||
'gray-hsb': function(color) {
|
||||
|
|
Loading…
Reference in a new issue