mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: color_dim(): retain alpha channel
This commit is contained in:
parent
6b6abb0419
commit
e17c6fcbec
1 changed files with 2 additions and 1 deletions
3
render.c
3
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue