mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer/metal: only apply min contrast if set and only on non-color fg
This commit is contained in:
@ -168,7 +168,14 @@ vertex VertexOut uber_vertex(
|
|||||||
// (between 0.0 and 1.0) and must be done in the fragment shader.
|
// (between 0.0 and 1.0) and must be done in the fragment shader.
|
||||||
out.tex_coord = float2(input.glyph_pos) + float2(input.glyph_size) * position;
|
out.tex_coord = float2(input.glyph_pos) + float2(input.glyph_size) * position;
|
||||||
|
|
||||||
out.color = contrasted_color(uniforms.min_contrast, out.color, float4(input.bg_color) / 255.0f);
|
// If we have a minimum contrast, we need to check if we need to
|
||||||
|
// change the color of the text to ensure it has enough contrast
|
||||||
|
// with the background.
|
||||||
|
if (uniforms.min_contrast > 1.0f && input.mode == MODE_FG) {
|
||||||
|
float4 bg_color = float4(input.bg_color) / 255.0f;
|
||||||
|
out.color = contrasted_color(uniforms.min_contrast, out.color, bg_color);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user