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) <noreply@anthropic.com>
This commit is contained in:
z3rco 2026-04-06 17:51:02 +01:00
parent aceaef8a1d
commit dc2bebd89e

View file

@ -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