Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const extract_hsba = color => {
let hsba = culoriHsv(color);
let ret = {};
if (!hsba) return ret;
if (hsba.h !== undefined) ret['hue'] = hsba.h;
if (hsba.s !== undefined) ret['saturation'] = hsba.s * 100;
if (hsba.v !== undefined) ret['brightness'] = hsba.v * 100;
if (hsba.alpha !== undefined) {
ret['opacity'] = roundi(hsba.alpha * 100);
} else {
ret['opacity'] = 100;
}
return ret;
};