pixel-utils
Version:
Utility Functions for Pixels
17 lines (16 loc) • 410 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = pushAlpha;
/**
* @description converts an RGB to an RGBA by pushing an alpha value at the end of the RGB array
* @param rgb - a 3-number RGB pixel
* @returns rgba - a 4-number array representing an RGBA pixel
*/
function pushAlpha(pixel) {
// @ts-ignore
pixel.push(255);
// @ts-ignore
return pixel;
}