diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-08-31 13:45:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-31 13:45:26 -0700 |
| commit | 2009ea511d30efd4fb96bd8788b18767f614956d (patch) | |
| tree | 90b9132a7186f02ed790a9484f4dce99a47732c4 /src/renderer | |
| parent | d8578a9ee2d89931449917e7afcdcf14510b4988 (diff) | |
| parent | 650095e7e9ff0ae8c802b22a07cdebe2b155adf9 (diff) | |
feat: added faint-opacity option (#8472)
This pull request adds the `--faint-opacity` option, as discussed in
#7637.
The default value of the option is also changed from `0.68` to `0.5` for
greater consistency with other popular terminal emulators.
Diffstat (limited to 'src/renderer')
| -rw-r--r-- | src/renderer/generic.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/renderer/generic.zig b/src/renderer/generic.zig index 476aa31ec..1305dc3dc 100644 --- a/src/renderer/generic.zig +++ b/src/renderer/generic.zig @@ -522,6 +522,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { selection_background: ?configpkg.Config.TerminalColor, selection_foreground: ?configpkg.Config.TerminalColor, bold_color: ?configpkg.BoldColor, + faint_opacity: u8, min_contrast: f32, padding_color: configpkg.WindowPaddingColor, custom_shaders: configpkg.RepeatablePath, @@ -584,6 +585,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { .background = config.background.toTerminalRGB(), .foreground = config.foreground.toTerminalRGB(), .bold_color = config.@"bold-color", + .faint_opacity = @intFromFloat(@ceil(config.@"faint-opacity" * 255)), .min_contrast = @floatCast(config.@"minimum-contrast"), .padding_color = config.@"window-padding-color", @@ -2633,7 +2635,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { }; // Foreground alpha for this cell. - const alpha: u8 = if (style.flags.faint) 175 else 255; + const alpha: u8 = if (style.flags.faint) self.config.faint_opacity else 255; // Set the cell's background color. { |
