color-fns
Version:
Modern JavaScript color utility library.
14 lines • 527 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("./utils");
function formatHsl(value) {
if (!value) {
return 'Invalid Color';
}
if (value.alpha !== undefined && utils_1.isBetween(0, 0.999)(value.alpha)) {
return "hsla(" + value.hue + "," + value.sat + "%," + value.lum + "%," + value.alpha + ")";
}
return "hsl(" + value.hue + "," + value.sat + "%," + value.lum + "%)";
}
exports.formatHsl = formatHsl;
//# sourceMappingURL=formatHsl.js.map