StyleImageRgba constructor

StyleImageRgba({
  1. required int width,
  2. required int height,
  3. required Uint8List pixels,
})

Throws ArgumentError if pixels length is not 4 * width * height.

Implementation

StyleImageRgba({
  required this.width,
  required this.height,
  required this.pixels,
}) : super._() {
  if (pixels.length != 4 * width * height) {
    throw ArgumentError.value(
      pixels.length,
      'pixels',
      'must be 4 * width * height (${4 * width * height}) for a ${width}x$height image',
    );
  }
}