mirror of
https://github.com/less/less.js.git
synced 2026-02-09 14:35:44 -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user