两种功能都以某种方式产生"较浅"的颜色,但使用不同的方法.
看看源代码,了解它们的工作原理:
tint: function(color, amount) {
return this.mix(this.rgb(255,255,255), color, amount);
},
Run Code Online (Sandbox Code Playgroud)
lighten: function (color, amount) {
var hsl = color.toHSL();
hsl.l += amount.value / 100;
hsl.l = clamp(hsl.l);
return hsla(hsl);
},
Run Code Online (Sandbox Code Playgroud)
因此tint混合为白色(如文档所述)并lighten增加HSL颜色模型的亮度.