mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: dim/brighten: multiply/divide instead of add/subtract
This commit is contained in:
parent
2b8e2b3506
commit
690cf0ab54
1 changed files with 2 additions and 2 deletions
4
render.c
4
render.c
|
|
@ -237,7 +237,7 @@ color_dim(uint32_t color)
|
|||
{
|
||||
int hue, sat, lum;
|
||||
rgb_to_hsl(color, &hue, &sat, &lum);
|
||||
return hsl_to_rgb(hue, sat, max(0, lum - 15));
|
||||
return hsl_to_rgb(hue, sat, lum / 1.5);
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
|
|
@ -245,7 +245,7 @@ color_brighten(uint32_t color)
|
|||
{
|
||||
int hue, sat, lum;
|
||||
rgb_to_hsl(color, &hue, &sat, &lum);
|
||||
return hsl_to_rgb(hue, sat, min(100, lum + 15));
|
||||
return hsl_to_rgb(hue, sat, min(100, lum * 1.3));
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue