@kcuf/mere-color
Version:
Mere color utils for generating, manipulation, a11y purposes.
15 lines (14 loc) • 364 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = desaturate;
var _util = require("../util");
/**
* Decreases the intensity of a color.
*/
function desaturate(color, amount) {
return (0, _util.manipulateHsl)(color, function (hsl) {
return (0, _util.hslShiftSaturation)(hsl, amount > 0 ? -amount : 0);
});
}