diff options
Diffstat (limited to 'core/ansi.zig')
| -rw-r--r-- | core/ansi.zig | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/core/ansi.zig b/core/ansi.zig index 3772de43..3fb866fc 100644 --- a/core/ansi.zig +++ b/core/ansi.zig @@ -20,33 +20,12 @@ const Surface = pardes.Surface; const BodyWalk = @import("body_layer.zig").BodyWalk; const EditBuffer = panes.Text.EditBuffer; -/// The theme's colours as a terminal's paint takes them. -pub fn inkOf(theme: *const pardes.LegacyTheme) Term.Ink { - return .{ - .fg = theme.fg, - .bg = theme.bg, - .tag_fg = theme.tag_fg, - .tag_bg = theme.tag_bg, - .palette = theme.palette, - .base = theme.palette orelse .{ - theme.bg orelse theme.tag_bg, - theme.kw, - theme.str, - theme.num, - theme.box, - theme.sel_bg, - theme.comment, - theme.fg orelse theme.tag_fg, - theme.lineno, - theme.kw, - theme.str, - theme.num, - theme.scroll_thumb, - theme.sel_fg, - theme.tag_fg, - theme.fg orelse theme.tag_fg, - }, - }; +/// The theme's colours as a terminal's paint takes them (Chrome's: its page, +/// text, faint and sixteen); a theme that leaves them to the host (`dark`) +/// leaves them to a tty, and a window draws its own (DESIGN.md R14). +pub fn inkOf(p: *const Pardes) Term.Ink { + const c = p.chrome(); + return .{ .fg = c.page.text, .bg = c.page.ground, .dim = c.page.dim, .ansi = c.ansi, .host = c.host_page and !p.view().frontend.windowed }; } /// Its program's colours over the body's rows, through the theme's filter @@ -85,7 +64,7 @@ pub fn recolor(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw { const tz_paint = tracy.zone(@src(), "termPaint"); defer tz_paint.end(); - const ink = inkOf(p.theme()); + const ink = inkOf(p); Term.paint(state, &ink, &p.tty_filter_palette, pane.tty_filter, pane.scrolled_to, @intCast(lo), cols, cells, rows); } const filtered = pane.tty_filter; |
