setForeground method

void setForeground(
  1. int x,
  2. int y,
  3. int fg
)

Sets foreground color at coordinates.

Implementation

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