mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-31 03:13:40 +00:00
terminal: move color state fully into the terminal for fg/bg/cursor
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user