setBackground method

void setBackground(
  1. int x,
  2. int y,
  3. int bg
)

Sets background color at coordinates.

Implementation

void setBackground(int x, int y, int bg) {
  if (x >= 0 && x < width && y >= 0 && y < height) {
    attributes[(y * width + x) * 3 + 1] = bg;
  }
}