From 5f12fbc2eeb00b2819340c5ff47bbafe24cbfbb1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 28 Oct 2021 11:18:16 +0530 Subject: [PATCH] Convenient aliases --- kitty/colors.c | 4 ++++ kitty/fast_data_types.pyi | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kitty/colors.c b/kitty/colors.c index 406633012..d815dc7ff 100644 --- a/kitty/colors.c +++ b/kitty/colors.c @@ -546,6 +546,10 @@ static PyGetSetDef color_getsetters[] = { {"green", (getter) green_get, NULL, "green", NULL}, {"blue", (getter) blue_get, NULL, "blue", NULL}, {"alpha", (getter) alpha_get, NULL, "alpha", NULL}, + {"r", (getter) red_get, NULL, "red", NULL}, + {"g", (getter) green_get, NULL, "green", NULL}, + {"b", (getter) blue_get, NULL, "blue", NULL}, + {"a", (getter) alpha_get, NULL, "alpha", NULL}, {"luminance", (getter) luminance_get, NULL, "luminance", NULL}, {"as_sgr", (getter) sgr_get, NULL, "as_sgr", NULL}, {"as_sharp", (getter) sharp_get, NULL, "as_sharp", NULL}, diff --git a/kitty/fast_data_types.pyi b/kitty/fast_data_types.pyi index 0ed94730a..e58f1549d 100644 --- a/kitty/fast_data_types.pyi +++ b/kitty/fast_data_types.pyi @@ -627,18 +627,22 @@ class Color: @property def red(self) -> int: pass + r = red @property def green(self) -> int: pass + g = green @property def blue(self) -> int: pass + b = blue @property def alpha(self) -> int: pass + a = alpha @property def luminance(self) -> float: