fill method
Clears and fills the given rectangle with the given (or default) background Color.
Implementation
void fill(final int x, int y, int width, int height, [Color? color]) {
color ??= background;
// fail fast
boundsCheck(x, y);
boundsCheck(x + width - 1, y + height - 1);
var char = Char.create(CharCode.space, foreground, color);
for (var fy = y; fy < y + height; fy++) {
for (var fx = x; fx < x + width; fx++) {
drawChar(fx, fy, char);
}
}
}