aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <[email protected]>2017-07-31 14:49:20 +1000
committerDylan Araps <[email protected]>2017-07-31 14:49:20 +1000
commitd9f523a85e545d31af9b42bd7a4f9c97abaefa74 (patch)
treef7c842a7806736342b28c77ae3395df8715f7ce3
parentsequences: shorten var (diff)
downloadpywal-d9f523a85e545d31af9b42bd7a4f9c97abaefa74.tar.xz
pywal-d9f523a85e545d31af9b42bd7a4f9c97abaefa74.zip
colors: Fix bug with brighter backgrounds
-rw-r--r--pywal/colors.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 1668a13..64707be 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -56,7 +56,9 @@ def sort_colors(img, colors):
raw_colors = colors[:1] + colors[9:] + colors[8:]
# Darken the background color if it's too light.
- if int(raw_colors[0][1]) >= 3:
+ # The value can be a letter or an int so we treat the
+ # entire test as strings.
+ if raw_colors[0][1] not in ["0", "1", "2"]:
raw_colors[0] = util.darken_color(raw_colors[0], 0.25)
colors = {"wallpaper": img}