Sets foreground color at coordinates.
void setForeground(int x, int y, int fg) { if (isCellValid(x, y)) { attributes[(y * width + x) * 3 + 0] = fg; } }