How to use the pureimage/src/uint32.fromBytesBigEndian function in pureimage

To help you get started, we’ve selected a few pureimage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vladimiry / ElectronMail / src / electron-main / api / endpoints-builders / tray-icon / lib.ts View on Github external
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),
    };
}