Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function color2hsl(color) {
const [ hue, saturation, lightness ] = color.colorspace === 'rgb'
? rgb2hsl(color.red, color.green, color.blue, color.hue)
: color.colorspace === 'hwb'
? hwb2hsl(color.hue, color.whiteness, color.blackness)
: [ color.hue, color.saturation, color.lightness ];
return { hue, saturation, lightness, alpha: color.alpha, colorspace: 'hsl' };
}