mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Introduce luminance function.
The behaviour of this function is identical to luma prior to LESS 1.7.
This commit is contained in:
@@ -95,6 +95,14 @@ tree.functions = {
|
||||
luma: function (color) {
|
||||
return new(tree.Dimension)(Math.round(color.luma() * color.alpha * 100), '%');
|
||||
},
|
||||
luminance: function (color) {
|
||||
var luminance =
|
||||
(0.2126 * color.rgb[0] / 255)
|
||||
+ (0.7152 * color.rgb[1] / 255)
|
||||
+ (0.0722 * color.rgb[2] / 255);
|
||||
|
||||
return new(tree.Dimension)(Math.round(luminance * color.alpha * 100), '%');
|
||||
},
|
||||
saturate: function (color, amount) {
|
||||
// filter: saturate(3.2);
|
||||
// should be kept as is, so check for color
|
||||
|
||||
Reference in New Issue
Block a user