Cleaned up parts of functions.js

making the code more lint-friendly
This commit is contained in:
Mehran Kholdi
2012-08-23 15:02:02 +04:30
committed by Luke Page
parent 695af3d597
commit e1dc5a18d1

View File

@@ -5,8 +5,8 @@ tree.functions = {
return this.rgba(r, g, b, 1.0);
},
rgba: function (r, g, b, a) {
var rgb = [r, g, b].map(function (c) { return number(c) }),
a = number(a);
var rgb = [r, g, b].map(function (c) { return number(c); });
a = number(a);
return new(tree.Color)(rgb, a);
},
hsl: function (h, s, l) {
@@ -86,8 +86,8 @@ tree.functions = {
luma: function (color) {
return new(tree.Dimension)(Math.round((0.2126 * (color.rgb[0]/255) +
0.7152 * (color.rgb[1]/255) +
0.0722 * (color.rgb[2]/255))
* color.alpha * 100), '%');
0.0722 * (color.rgb[2]/255)) *
color.alpha * 100), '%');
},
saturate: function (color, amount) {
var hsl = color.toHSL();
@@ -343,8 +343,8 @@ tree.functions = {
}
};
function hsla(hsla) {
return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a);
function hsla(color) {
return tree.functions.hsla(color.h, color.s, color.l, color.a);
}
function number(n) {