image-in-browser
Version:
Package for encoding / decoding images, transforming images, applying filters, drawing primitives on images on the client side (no need for server Node.js)
17 lines • 491 B
JavaScript
import { ColorUint8 } from './color-uint8.js';
export class ColorRgba8 extends ColorUint8 {
constructor(r, g, b, a) {
const data = new Uint8Array([r, g, b, a]);
super(data);
}
static from(other) {
const data = new Uint8Array([
other.getChannel(0),
other.getChannel(1),
other.getChannel(2),
other.getChannel(3),
]);
return new ColorUint8(data);
}
}
//# sourceMappingURL=color-rgba8.js.map