render: color_dim(): retain alpha channel

This commit is contained in:
Daniel Eklöf 2021-07-22 19:22:19 +02:00
parent 6b6abb0419
commit e17c6fcbec
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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