From 52015cc8c8e3b3e46a39f039c06d272e7362fd04 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Mar 2026 21:15:59 +0530 Subject: [PATCH] Cleanup previous PR --- kitty/colors.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kitty/colors.c b/kitty/colors.c index fb73eb05c..5f88febb1 100644 --- a/kitty/colors.c +++ b/kitty/colors.c @@ -614,15 +614,11 @@ set_color(ColorProfile *self, PyObject *args) { unsigned char i; unsigned long val; if (!PyArg_ParseTuple(args, "Bk", &i, &val)) return NULL; - self->color_table[i] = val; self->dirty = true; - if (val == NULL_COLOR_VALUE) { + if (val == NULL_COLOR_VALUE && i >= 16) { bool semantic, dynamic = palette_generation_is_dynamic(global_state.options_object, &semantic); - if (dynamic) { - if (i >= 16) self->color_table[i] = generate_256_palette_color(self, self->color_table, i, semantic); - else generate_256_palette(self, self->color_table, semantic); - } else self->color_table[i] = FG_BG_256[i]; - } + self->color_table[i] = dynamic ? generate_256_palette_color(self, self->color_table, i, semantic) : FG_BG_256[i]; + } else self->color_table[i] = val; Py_RETURN_NONE; }