diff --git a/kitty/colors.c b/kitty/colors.c index 7cc3640b7..4f5750d6f 100644 --- a/kitty/colors.c +++ b/kitty/colors.c @@ -265,7 +265,10 @@ as_color(ColorProfile *self, PyObject *val) { Py_RETURN_NONE; } Color *ans = PyObject_New(Color, &Color_Type); - if (ans) ans->color.rgb = col; + if (ans) { + ans->color.val = 0; + ans->color.rgb = col; + } return (PyObject*)ans; } diff --git a/kitty/typing.pyi b/kitty/typing.pyi index 0f9293a9c..9f7c3bf20 100644 --- a/kitty/typing.pyi +++ b/kitty/typing.pyi @@ -36,7 +36,7 @@ EdgeLiteral = Literal['left', 'top', 'right', 'bottom'] UnderlineLiteral = Literal['straight', 'double', 'curly', 'dotted', 'dashed'] MatchType = Literal['mime', 'ext', 'protocol', 'file', 'path', 'url', 'fragment_matches'] PowerlineStyle = Literal['angled', 'slanted', 'round'] -GRT_a = Literal['t', 'T', 'q', 'p', 'd', 'f', 'a', 'c', 'q'] +GRT_a = Literal['t', 'T', 'q', 'p', 'd', 'f', 'a', 'c'] GRT_f = Literal[24, 32, 100] GRT_t = Literal['d', 'f', 't', 's'] GRT_o = Literal['z'] diff --git a/kitty_tests/datatypes.py b/kitty_tests/datatypes.py index c3be731a0..bf4b24588 100644 --- a/kitty_tests/datatypes.py +++ b/kitty_tests/datatypes.py @@ -443,7 +443,7 @@ class TestDataTypes(BaseTest): c.update_ansi_color_table(build_ansi_color_table()) for i in range(8): col = getattr(defaults, f'color{i}') - self.assertEqual(c.as_color(i << 8 | 1), col) + self.ae(c.as_color(i << 8 | 1), col) self.ae(c.as_color(255 << 8 | 1), Color(0xee, 0xee, 0xee)) def test_historybuf(self):