mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
Implement tint and shade functions
This commit is contained in:
@@ -304,6 +304,12 @@ tree.functions = {
|
||||
var g = 255 - Math.abs(255 - color2.rgb[1] - color1.rgb[1]);
|
||||
var b = 255 - Math.abs(255 - color2.rgb[2] - color1.rgb[2]);
|
||||
return this.rgb(r, g, b);
|
||||
},
|
||||
tint: function(color, amount) {
|
||||
return this.mix(this.rgb(255,255,255), color, amount);
|
||||
},
|
||||
shade: function(color, amount) {
|
||||
return this.mix(this.rgb(0, 0, 0), color, amount);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -54,6 +54,12 @@
|
||||
roundedpx-three: 3.333px;
|
||||
percentage: 20%;
|
||||
color: #ff0011;
|
||||
tint: #898989;
|
||||
tint-full: #ffffff;
|
||||
tint-percent: #898989;
|
||||
shade: #686868;
|
||||
shade-full: #000000;
|
||||
shade-percent: #686868;
|
||||
mix: #ff3300;
|
||||
mix-0: #ffff00;
|
||||
mix-100: #ff0000;
|
||||
|
||||
@@ -59,6 +59,12 @@
|
||||
roundedpx-three: round(10px / 3, 3);
|
||||
percentage: percentage(10px / 50);
|
||||
color: color("#ff0011");
|
||||
tint: tint(#777777, 13);
|
||||
tint-full: tint(#777777, 100);
|
||||
tint-percent: tint(#777777, 13%);
|
||||
shade: shade(#777777, 13);
|
||||
shade-full: shade(#777777, 100);
|
||||
shade-percent: shade(#777777, 13%);
|
||||
|
||||
mix: mix(#ff0000, #ffff00, 80);
|
||||
mix-0: mix(#ff0000, #ffff00, 0);
|
||||
|
||||
Reference in New Issue
Block a user