terminal: move color state fully into the terminal for fg/bg/cursor

This commit is contained in:
Mitchell Hashimoto
2025-10-30 09:26:58 -07:00
parent cabca0aca8
commit 77343bb06e
4 changed files with 92 additions and 114 deletions

View File

@@ -4960,6 +4960,13 @@ pub const TerminalColor = union(enum) {
return .{ .color = try Color.parseCLI(input) };
}
pub fn toTerminalRGB(self: TerminalColor) ?terminal.color.RGB {
return switch (self) {
.color => |v| v.toTerminalRGB(),
.@"cell-foreground", .@"cell-background" => null,
};
}
/// Used by Formatter
pub fn formatEntry(self: TerminalColor, formatter: formatterpkg.EntryFormatter) !void {
switch (self) {