mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Cleaned up parts of functions.js
making the code more lint-friendly
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user