Adds colour functions to less not provided by core
APACHE-2.0 License
Adds some advanced colour functions that helps in finding more contrasting colors:
npm install -g less-plugin-advanced-color-functions
and then on the command line,
lessc file.less --advanced-color-functions
var LessPluginAdvancedColorFunctions = require('less-plugin-advanced-color-functions'),
AdvancedColorFunctions = new LessPluginAdvancedColorFunctions();
less.render(lessString, { plugins: [AdvancedColorFunctions] })
.then(
Browser usage is not supported at this time.
@color1: #ff0000;
@color2: #ee0000;
.colors {
invertluma: invertluma(@color1);
contrastmore: contrastmore(@color1,@color2);
autocontrast: autocontrast(@color1,@color2);
autocontrast50: autocontrast(@color1,@color2,50%);
}
outputs:
.colors {
invertluma: #ff0000;
contrastmore: #650000;
autocontrast: #ff7878;
autocontrast50: #ffdede;
}
The compiled coloures will look like that shown below: