summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 23:14:39 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commita7a446e0f32cb9daaa06689c91ef7de01bfc968c (patch)
treec51501cb55862f0b527606292e61d04e0e78edaf /src/gui
parentb2163c0a53a6276bc8e1211e9a7c9584bb1ccb2e (diff)
downloadpardes-a7a446e0f32cb9daaa06689c91ef7de01bfc968c.tar.gz
pardes-a7a446e0f32cb9daaa06689c91ef7de01bfc968c.zip
colors: the 256-colour palette is pardes's own, colors.xterm (the sixteen named colours Art.zig kept, xterm's 6x6x6 cube and 24-grey ramp, at comptime), so Art.zig and gui.zig stop importing ghostty-vt: Art's Petscii takes its first sixteen and drops its comptime check against the emulator, gui.zig's palColor goes and its two .index cells read the table; terminal.zig's test holds all 256 entries to ghostty-vt's color.default; the changelog says so
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 51ec6bbf..202f4aa8 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -7,7 +7,6 @@ const posix = std.posix;
/// libc: pipes and fcntl for the window's wakes, and a test harness's capture files written from the render thread.
const libc = std.c;
const vaxis = @import("vaxis"); // test modes only: the stdin escape-seq parser
-const ghostty_vt = @import("ghostty-vt"); // 256-color palette for .index cells
const pardes = @import("../pardes.zig");
const vaxis_input = @import("../vaxis_input.zig");
const dump = @import("../dump.zig");
@@ -4762,12 +4761,12 @@ fn resolveCell(g: *Gui, line: []const pardes.Cell, at: usize, cursor: ?usize, ro
const st = cell.style;
fg = switch (st.fg) {
.default => fg_default,
- .index => |i| palColor(i),
+ .index => |i| pardes.colors.xterm[i],
.rgb => |rgb| rgb,
};
switch (st.bg) {
.default => {},
- .index => |i| bg = palColor(i),
+ .index => |i| bg = pardes.colors.xterm[i],
.rgb => |rgb| bg = rgb,
}
if (st.reverse) reverse = !reverse;
@@ -5139,11 +5138,6 @@ fn cellCodepoint(cell: *const pardes.Cell) u32 {
return if (cell.default or grapheme.len == 0) ' ' else firstCp(grapheme);
}
-fn palColor(idx: u8) [3]u8 {
- const p = ghostty_vt.color.default[idx];
- return .{ p.r, p.g, p.b };
-}
-
fn firstCp(s: []const u8) u32 {
if (s.len == 0) return ' ';
const n = std.unicode.utf8ByteSequenceLength(s[0]) catch return ' ';