diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-07-28 11:56:30 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-07-28 11:56:30 +1000 |
| commit | ef9f8f28c9d8e2cc10e1b56063e41d41db90efbf (patch) | |
| tree | bd353a00013721b101ff4850553ecc21859cbef0 /pywal/colors.py | |
| parent | 017547ff0a1dad869133c81d184a4a94f76b8f87 (diff) | |
colors: Darken bg if contrast is too low.
Diffstat (limited to 'pywal/colors.py')
| -rw-r--r-- | pywal/colors.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pywal/colors.py b/pywal/colors.py index c939215..b2c390e 100644 --- a/pywal/colors.py +++ b/pywal/colors.py @@ -54,6 +54,13 @@ def sort_colors(img, colors): we will later save in json format.""" raw_colors = colors[:1] + colors[9:] + colors[8:] + # Darken the background color if it's too light. + if int(raw_colors[0][1]) in [3, 4]: + raw_colors[0] = util.darken_color(raw_colors[0], 0.50) + + elif int(raw_colors[0][1]) >= 5: + raw_colors[0] = util.darken_color(raw_colors[0], 0.25) + colors = {"wallpaper": img} colors_special = {} |
