diff --git a/kitty/cell_vertex.glsl b/kitty/cell_vertex.glsl index 325d8d453..a9e5729b8 100644 --- a/kitty/cell_vertex.glsl +++ b/kitty/cell_vertex.glsl @@ -162,7 +162,8 @@ void main() { float cell_has_cursor = is_cursor(c, r); float is_block_cursor = step(float(cursor_fg_sprite_idx), 0.5); float cell_has_block_cursor = cell_has_cursor * is_block_cursor; - vec3 bg = color_to_vec(resolve_color(colors[bg_index], default_colors[bg_index])); + uint bg_as_uint = resolve_color(colors[bg_index], default_colors[bg_index]); + vec3 bg = color_to_vec(bg_as_uint); // }}} // Foreground {{{ @@ -200,7 +201,7 @@ void main() { // Background {{{ #ifdef NEEDS_BACKROUND - float cell_has_non_default_bg = step(ONE, colors[bg_index] & BYTE_MASK); + float cell_has_non_default_bg = step(ONE, abs(bg_as_uint - default_colors[bg_index])); #if defined(BACKGROUND) background = bg;