setCell method
void
setCell(})
Sets character, colors, and modifiers at coordinates.
When blend is true (or omitted when defaultBlend is true), fg
and bg are alpha-blended over existing cell colors. When false, they
replace existing colors directly so 0 resets to the terminal default.
Implementation
void setCell(
int x,
int y,
String char,
int fg,
int bg,
int mod, {
bool? blend,
int underlineColor = 0,
String? uri,
}) {
if (isCellValid(x, y)) {
final useBlend = blend ?? defaultBlend;
final cellIdx = y * width + x;
final idx = cellIdx * 3;
characters[cellIdx] = char;
attributes[idx + 0] = useBlend ? blendColor(fg, attributes[idx + 0]) : fg;
attributes[idx + 1] = useBlend ? blendColor(bg, attributes[idx + 1]) : bg;
attributes[idx + 2] = mod;
_setUnderlineColorAt(cellIdx, underlineColor);
_setUriAt(cellIdx, uri);
}
}