fill abstract method

void fill(
  1. T pixel, [
  2. Rect? target
])

Fill the buffer with the given pixel.

This is equivalent to calling set for every pixel in the buffer.

If a target rectangle is provided, only the pixels within that rectangle will be filled, and the rectangle will be clipped to the bounds of the buffer. If omitted, the entire buffer will be filled.

Example

final pixels = IntPixels(2, 2);
pixels.fill(0xFFFFFFFF);
pixels.fill(0x00000000,  Rect.fromLTWH(1, 0, 1, 2));

Implementation

void fill(T pixel, [Rect? target]);