mirror of
https://github.com/less/less.js.git
synced 2026-01-22 13:48:03 -05:00
Add bypass for saturate(5%) filter function. Helps issue #1299
This commit is contained in:
@@ -96,6 +96,11 @@ tree.functions = {
|
||||
return new(tree.Dimension)(Math.round(color.luma() * color.alpha * 100), '%');
|
||||
},
|
||||
saturate: function (color, amount) {
|
||||
// filter: saturate(3.2);
|
||||
// should be kept as is, so check for color
|
||||
if (!color.rgb) {
|
||||
return null;
|
||||
}
|
||||
var hsl = color.toHSL();
|
||||
|
||||
hsl.s += amount.value / 100;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
luma-cyan: 79%;
|
||||
luma-white-alpha: 50%;
|
||||
contrast-filter: contrast(30%);
|
||||
saturate-filter: saturate(5%);
|
||||
contrast-white: #000000;
|
||||
contrast-black: #ffffff;
|
||||
contrast-red: #ffffff;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
luma-cyan: luma(#00ffff);
|
||||
luma-white-alpha: luma(rgba(255,255,255,0.5));
|
||||
contrast-filter: contrast(30%);
|
||||
saturate-filter: saturate(5%);
|
||||
contrast-white: contrast(#fff);
|
||||
contrast-black: contrast(#000);
|
||||
contrast-red: contrast(#ff0000);
|
||||
|
||||
Reference in New Issue
Block a user