mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Variable chaining.
This commit is contained in:
parent
32fb1b065e
commit
1473d82456
1 changed files with 8 additions and 8 deletions
|
@ -333,14 +333,14 @@ var Color = this.Color = Base.extend(new function() {
|
||||||
|
|
||||||
toCssString: function() {
|
toCssString: function() {
|
||||||
if (!this._cssString) {
|
if (!this._cssString) {
|
||||||
var color = this.convert('rgb');
|
var color = this.convert('rgb'),
|
||||||
var alpha = color.getAlpha();
|
alpha = color.getAlpha(),
|
||||||
var components = [
|
components = [
|
||||||
Math.round(color.getRed() * 255),
|
Math.round(color.getRed() * 255),
|
||||||
Math.round(color.getGreen() * 255),
|
Math.round(color.getGreen() * 255),
|
||||||
Math.round(color.getBlue() * 255),
|
Math.round(color.getBlue() * 255),
|
||||||
alpha != null ? this.alpha : 1
|
alpha != null ? this.alpha : 1
|
||||||
];
|
];
|
||||||
this._cssString = 'rgba(' + components.join(', ') + ')';
|
this._cssString = 'rgba(' + components.join(', ') + ')';
|
||||||
}
|
}
|
||||||
return this._cssString;
|
return this._cssString;
|
||||||
|
|
Loading…
Reference in a new issue