refactor: move faint-opacity clamping to config finalization
parent
fc6266133f
commit
6319464cfb
|
|
@ -4024,6 +4024,8 @@ pub fn finalize(self: *Config) !void {
|
|||
if (self.@"auto-update-channel" == null) {
|
||||
self.@"auto-update-channel" = build_config.release_channel;
|
||||
}
|
||||
|
||||
self.@"faint-opacity" = std.math.clamp(self.@"faint-opacity", 0.0, 1.0);
|
||||
}
|
||||
|
||||
/// Callback for src/cli/args.zig to allow us to handle special cases
|
||||
|
|
|
|||
|
|
@ -585,7 +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(std.math.clamp(config.@"faint-opacity", 0.0, 1.0) * 255)),
|
||||
.faint_opacity = @intFromFloat(@ceil(config.@"faint-opacity" * 255)),
|
||||
|
||||
.min_contrast = @floatCast(config.@"minimum-contrast"),
|
||||
.padding_color = config.@"window-padding-color",
|
||||
|
|
|
|||
Loading…
Reference in New Issue