setCell method
Sets character, colors, and modifiers at coordinates.
Implementation
void setCell(int x, int y, String char, int fg, int bg, int mod) {
if (x >= 0 && x < width && y >= 0 && y < height) {
final idx = (y * width + x) * 3;
characters[y * width + x] = char;
attributes[idx + 0] = fg;
attributes[idx + 1] = bg;
attributes[idx + 2] = mod;
}
}