From e17c6fcbecf67a75bf8cd37995fac0e937b934cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 22 Jul 2021 19:22:19 +0200 Subject: [PATCH] render: color_dim(): retain alpha channel --- render.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index 6e0e82bf..f4ebc086 100644 --- a/render.c +++ b/render.c @@ -246,9 +246,10 @@ color_hex_to_pixman(uint32_t color) static inline uint32_t color_dim(uint32_t color) { + uint32_t alpha = color & 0xff000000; int hue, sat, lum; rgb_to_hsl(color, &hue, &sat, &lum); - return hsl_to_rgb(hue, sat, lum / 1.5); + return alpha | hsl_to_rgb(hue, sat, lum / 1.5); } static inline uint32_t