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] = blendColor(fg, attributes[idx + 0]);
attributes[idx + 1] = blendColor(bg, attributes[idx + 1]);
attributes[idx + 2] = mod;
}
}