vendor/lib/nodes/rgba.js in stylus-source-0.49.3 vs vendor/lib/nodes/rgba.js in stylus-source-0.54.5
- old
+ new
@@ -1,9 +1,9 @@
/*!
* Stylus - RGBA
- * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
+ * Copyright (c) Automattic <developer.wordpress.com>
* MIT Licensed
*/
/**
* Module dependencies.
@@ -29,10 +29,11 @@
Node.call(this);
this.r = clamp(r);
this.g = clamp(g);
this.b = clamp(b);
this.a = clampAlpha(a);
+ this.name = '';
this.rgba = this;
};
/**
* Inherit from `Node.prototype`.
@@ -72,10 +73,11 @@
this.r
, this.g
, this.b
, this.a);
clone.raw = this.raw;
+ clone.name = this.name;
clone.lineno = this.lineno;
clone.column = this.column;
clone.filename = this.filename;
return clone;
};
@@ -93,10 +95,11 @@
r: this.r,
g: this.g,
b: this.b,
a: this.a,
raw: this.raw,
+ name: this.name,
lineno: this.lineno,
column: this.column,
filename: this.filename
};
};
@@ -279,9 +282,13 @@
function pad(n) {
return n < 16
? '0' + n.toString(16)
: n.toString(16);
}
+
+ // special case for transparent named color
+ if ('transparent' == this.name)
+ return this.name;
if (1 == this.a) {
var r = pad(this.r)
, g = pad(this.g)
, b = pad(this.b);