pixel-utils
Version:
Utility Functions for Pixels
17 lines (16 loc) • 420 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = sliceAlpha;
/**
* @name sliceAlpha
* @description slices off the alpha value of a 4-number RGBA pixel array,
* leaving a new 3-Number RGB pixel array
* @param {RGBA} pixel - an RGBA
* @returns {RGBA} an RGBA pixel as an array of 4 numbers
*/
function sliceAlpha(pixel) {
// @ts-ignore
return pixel.slice(0, 3);
}