summaryrefslogtreecommitdiff
path: root/abi
diff options
context:
space:
mode:
Diffstat (limited to 'abi')
-rw-r--r--abi/term.zig32
1 files changed, 16 insertions, 16 deletions
diff --git a/abi/term.zig b/abi/term.zig
index e84d6998..2fb7c260 100644
--- a/abi/term.zig
+++ b/abi/term.zig
@@ -136,33 +136,33 @@ pub const Span = struct { start: u32, end: u32, style: CellStyle };
// ---- its colours on the body ----
-/// A theme's colours as a terminal's paint takes them.
+/// A theme's colours as a terminal's paint takes them, worked out with the
+/// theme (colors.Chrome, DESIGN.md R1, R14, R15): its page, its text, SGR
+/// faint's ink on it, and its sixteen, which the filter keys a program's
+/// colours to as well. `host`: a theme that leaves its page and sixteen to
+/// the tty (`dark`), drawn in a tty, whose cells then name the tty's own.
pub const Ink = struct {
- fg: ?[3]u8,
- bg: ?[3]u8,
- tag_fg: [3]u8,
- tag_bg: [3]u8,
- /// The theme's own sixteen, when it has them.
- palette: ?[16][3]u8,
- /// The sixteen the filter keys a program's colours to: `palette`, else
- /// made of the theme's roles.
- base: [16][3]u8,
+ fg: [3]u8,
+ bg: [3]u8,
+ dim: [3]u8,
+ ansi: [16][3]u8,
+ host: bool,
- /// A palette index as the theme draws it: its own sixteen, else the
- /// index.
+ /// A palette index as the theme draws it: its sixteen, else the index.
pub fn palColor(ink: *const Ink, idx: u8) Color {
- if (ink.palette) |pal| if (idx < 16) return .{ .rgb = pal[idx] };
+ if (!ink.host and idx < 16) return .{ .rgb = ink.ansi[idx] };
return .{ .index = idx };
}
};
-/// The theme's 256 colours as the filter maps onto them, kept while the
-/// theme is the same (`Pardes.tty_filter_palette`).
+/// The theme's 256 colours as the filter maps onto them (ghostty's
+/// generator over its sixteen, page and text), made once a theme and kept
+/// while it is the same (`Pardes.tty_filter_palette`).
pub const FilterPalette = struct {
key: ?Key = null,
colors: [256][3]u8 = undefined,
- pub const Key = struct { bg: [3]u8, fg: [3]u8, base: [16][3]u8 };
+ pub const Key = struct { bg: [3]u8, fg: [3]u8, ansi: [16][3]u8 };
};
/// A program's colours mapped to the theme, once a frame: what a +Pager's