diff --git a/src/renderer/Metal.zig b/src/renderer/Metal.zig index 3f24c3d2dd..4247b82135 100644 --- a/src/renderer/Metal.zig +++ b/src/renderer/Metal.zig @@ -1186,9 +1186,9 @@ pub fn drawFrame(self: *Metal, surface: *apprt.Surface) !void { attachment.setProperty("storeAction", @intFromEnum(mtl.MTLStoreAction.store)); attachment.setProperty("texture", screen_texture.value); attachment.setProperty("clearColor", mtl.MTLClearColor{ - .red = @as(f32, @floatFromInt(self.current_background_color.r)) / 255, - .green = @as(f32, @floatFromInt(self.current_background_color.g)) / 255, - .blue = @as(f32, @floatFromInt(self.current_background_color.b)) / 255, + .red = @as(f32, @floatFromInt(self.current_background_color.r)) / 255 * self.config.background_opacity, + .green = @as(f32, @floatFromInt(self.current_background_color.g)) / 255 * self.config.background_opacity, + .blue = @as(f32, @floatFromInt(self.current_background_color.b)) / 255 * self.config.background_opacity, .alpha = self.config.background_opacity, }); } diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index 19843062ca..1456ed3bb5 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -2344,9 +2344,9 @@ fn drawCellProgram( // Clear the surface gl.clearColor( - @as(f32, @floatFromInt(self.draw_background.r)) / 255, - @as(f32, @floatFromInt(self.draw_background.g)) / 255, - @as(f32, @floatFromInt(self.draw_background.b)) / 255, + @floatCast(@as(f32, @floatFromInt(self.draw_background.r)) / 255 * self.config.background_opacity), + @floatCast(@as(f32, @floatFromInt(self.draw_background.g)) / 255 * self.config.background_opacity), + @floatCast(@as(f32, @floatFromInt(self.draw_background.b)) / 255 * self.config.background_opacity), @floatCast(self.config.background_opacity), ); gl.clear(gl.c.GL_COLOR_BUFFER_BIT);