fillRect method

void fillRect(
  1. int x,
  2. int y,
  3. int w,
  4. int h,
  5. bool color,
)

draw a filled rectangle on the oled

Implementation

void fillRect(int x, int y, int w, int h, bool color) {
  // one iteration for each column of the rectangle
  for (var i = x; i < x + w; i += 1) {
    // draws a vert line
    drawLine(i, y, i, y + h - 1, color);
  }
}