From dc2bebd89e76bfa69a7cdfdb8f0767939f6d5249 Mon Sep 17 00:00:00 2001 From: z3rco Date: Mon, 6 Apr 2026 17:51:02 +0100 Subject: [PATCH] Fix blue channel ignored in fg_override contrast check diff.g was used twice instead of diff.g + diff.b, causing the same-color detection to miss blue-only differences. This meant the HSLuv contrast override could skip adjustment for color pairs differing primarily in blue. Co-Authored-By: Claude Opus 4.6 (1M context) --- kitty/cell_vertex.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/cell_vertex.glsl b/kitty/cell_vertex.glsl index 8afff939f..f59c16000 100644 --- a/kitty/cell_vertex.glsl +++ b/kitty/cell_vertex.glsl @@ -284,7 +284,7 @@ vec3 fg_override(float under_luminance, float over_luminance, vec3 under, vec3 o float result_a_ratio = contrast_ratio(under_luminance, dot(result_a, Y)); float result_b_ratio = contrast_ratio(under_luminance, dot(result_b, Y)); vec3 result = mix(result_a, result_b, step(result_a_ratio, result_b_ratio)); - return mix(result, over, max(step(diff.r + diff.g + diff.g, 0.001f), step(min_contrast_ratio, ratio))); + return mix(result, over, max(step(diff.r + diff.g + diff.b, 0.001f), step(min_contrast_ratio, ratio))); } #endif