From bb95b278b1cc7af0759cf5861a42ad9be989cf8d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 31 Jul 2017 11:11:14 +1000 Subject: [PATCH] colors: Fix bug with brighter backgrounds --- pywal/colors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pywal/colors.py b/pywal/colors.py index 1668a13..4a55cb8 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 it 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}