diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2018-06-21 10:45:30 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2018-06-21 10:45:30 +1000 |
| commit | 7704f529c14dd85f37b15918aba657d37fd1aef3 (patch) | |
| tree | 64052e09e5dbaa5056fd326cc39fcc9d6b38548c /pywal/util.py | |
| parent | 46351f20ac497e1901a55859c2a4978982048e8d (diff) | |
colors: Added saturate option. Closes #166
Diffstat (limited to 'pywal/util.py')
| -rw-r--r-- | pywal/util.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pywal/util.py b/pywal/util.py index 4495dbe..a915a43 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -149,10 +149,9 @@ def saturate_color(color, amount): """Saturate a hex color.""" r, g, b = hex_to_rgb(color) r, g, b = [x/255.0 for x in (r, g, b)] - h, s, v = colorsys.rgb_to_hsv(r, g, b) + h, l, s = colorsys.rgb_to_hls(r, g, b) s = amount - v = 0.2 - r, g, b = colorsys.hls_to_rgb(h, s, v) + r, g, b = colorsys.hls_to_rgb(h, l, s) r, g, b = [x*255.0 for x in (r, g, b)] return rgb_to_hex((int(r), int(g), int(b))) |
