Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const newHsl = {
hue: hsl.hue + hslColorShift.hue,
sat: hsl.sat + hslColorShift.sat,
lum: hsl.lum + hslColorShift.lum,
} as const;
const newRgb = hslToRgb(newHsl);
if (!newRgb) {
throw new Error(`Failed to form RGB value from HSL color: ${JSON.stringify(newHsl)}`);
}
bitmap.setPixelRGBA(
x,
y,
pureimageUInt32.fromBytesBigEndian(
newRgb.red,
newRgb.green,
newRgb.blue,
alpha,
),
);
}
}
return {
bitmap,
native: await bitmapToNativeImage(bitmap),
};
}