|
|
|
@ -12,6 +12,25 @@ tree.functions = {
|
|
|
|
|
hsl: function (h, s, l) {
|
|
|
|
|
return this.hsla(h, s, l, 1.0);
|
|
|
|
|
},
|
|
|
|
|
// Only require val
|
|
|
|
|
stop: function (val) {
|
|
|
|
|
if (arguments.length > 1) var color = arguments[1];
|
|
|
|
|
if (arguments.length > 2) var mode = arguments[2];
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
is: 'tag',
|
|
|
|
|
val: val,
|
|
|
|
|
color: color,
|
|
|
|
|
mode: mode,
|
|
|
|
|
toString: function(env) {
|
|
|
|
|
return '\n\t<stop value="' + val.eval(env) + '"' +
|
|
|
|
|
(color ? ' color="' + color.eval(env) + '" ' : '') +
|
|
|
|
|
(mode ? ' mode="' + mode.eval(env) + '" ' : '') +
|
|
|
|
|
'/>';
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
hsla: function (h, s, l, a) {
|
|
|
|
|
h = (number(h) % 360) / 360;
|
|
|
|
|
s = number(s); l = number(l); a = number(a);
|
|
|
|
|