UNPKG

lib-colors

Version:

Simple node.js library for work with colors

10 lines (9 loc) 382 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hslToString = hslToString; const alpha_is_set_helper_1 = require("../../helpers/alpha_is_set.helper"); function hslToString(hsl) { const { h, s, l, a } = { ...hsl }; const aValue = (0, alpha_is_set_helper_1.alphaIsSet)(a) ? ` / ${a}` : ''; return `hsl(${h}, ${s}%, ${l}%${aValue})`; }