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 (isCellValid(x, y)) {
final idx = (y * width + x) * 3;
characters[y * width + x] = char;
attributes[idx + 0] = fg;
attributes[idx + 1] = bg;
attributes[idx + 2] = mod;
}
}