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