mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-16 23:06:20 +00:00
ability to set selection fg/bg colors
This commit is contained in:
@@ -36,6 +36,12 @@ pub const Config = struct {
|
||||
/// Foreground color for the window.
|
||||
foreground: Color = .{ .r = 0xFF, .g = 0xFF, .b = 0xFF },
|
||||
|
||||
/// The foreground and background color for selection. If this is not
|
||||
/// set, then the selection color is just the inverted window background
|
||||
/// and foreground (note: not to be confused with the cell bg/fg).
|
||||
@"selection-foreground": ?Color = null,
|
||||
@"selection-background": ?Color = null,
|
||||
|
||||
/// Color palette for the 256 color form that many terminal applications
|
||||
/// use. The syntax of this configuration is "N=HEXCODE" where "n"
|
||||
/// is 0 to 255 (for the 256 colors) and HEXCODE is a typical RGB
|
||||
@@ -316,6 +322,11 @@ pub const Color = struct {
|
||||
InvalidFormat,
|
||||
};
|
||||
|
||||
/// Convert this to the terminal RGB struct
|
||||
pub fn toTerminalRGB(self: Color) terminal.color.RGB {
|
||||
return .{ .r = self.r, .g = self.g, .b = self.b };
|
||||
}
|
||||
|
||||
pub fn parseCLI(input: ?[]const u8) !Color {
|
||||
return fromHex(input orelse return error.ValueRequired);
|
||||
}
|
||||
|
Reference in New Issue
Block a user