diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-11-15 20:04:21 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-11-15 20:04:21 +0000 |
| commit | 690cf0ab549937fd5205c0ebbc3c18209302b11a (patch) | |
| tree | ad4d3cb9827597e0b1567b5cf7b3d82118c4c745 /render.c | |
| parent | render: dim and brighten colors by adjusting luminance (diff) | |
render: dim/brighten: multiply/divide instead of add/subtract
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |
