render/terminal_painter library

Classes

CursorPainter
Paints only the cursor cell, on a layer above TerminalPainter. Repaints on grid mutation (cursor move) and on blinkOn toggles — so an idle blink re-rasters a single cell instead of the whole grid. The block cursor redraws the underlying glyph in the cell's bg color, which correctly covers the grid layer's glyph below it.
HintColors
Background/foreground for hint-highlighted (hyperlink) cells.
SearchColors
TerminalPainter
Paints the terminal grid (backgrounds + glyphs + decorations) — everything except the cursor, which lives on its own CursorPainter layer so the blink timer doesn't repaint the whole grid. Repaints only on grid mutation.

Functions

applyMatchOrHint(int flags, ({int bg, int fg}) ec, SearchColors search, HintColors hint) → ({int bg, int fg})
Effective fg/bg with full precedence: focused-match > match > hyperlink > base.
cursorInk(int cursorColor, int inverseFg) Color
Cursor ink color: the program-set OSC 12 color when present, else an inverse-video cursor using the cell's effective fg. cursorColor is the raw snapshot value (0x00RRGGBB) or kCursorColorUnset.
cursorRect(int shape, double cellWidth, double cellHeight, double lineWidth) Rect
Cursor rect for shape (0 block, 1 underline, 2 beam, 3 hollow) at cell origin.
decorationYs(double cellTop, double cellHeight) → ({double strikeout, double underline})
effectiveColors(int flags, int rawFg, int rawBg) → ({int bg, int fg})
Packed-RGB fg/bg after applying inverse (swap) and dim (darken fg).