From cf09a8642614cd87ad644ee58dd1599f9c8a9b6d Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Tue, 19 Oct 2021 17:41:29 +0200 Subject: color gradient to black (#1395) --- lib/threads/color.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/threads/color.py') diff --git a/lib/threads/color.py b/lib/threads/color.py index 69a70798..4a2f58e6 100644 --- a/lib/threads/color.py +++ b/lib/threads/color.py @@ -15,6 +15,10 @@ class ThreadColor(object): hex_str_re = re.compile('#([0-9a-z]{3}|[0-9a-z]{6})', re.I) def __init__(self, color, name=None, number=None, manufacturer=None): + # set colors with a gradient to black (avoiding an error message) + if type(color) == str and color.startswith('url'): + color = None + if color is None: self.rgb = (0, 0, 0) elif isinstance(color, EmbThread): -- cgit v1.2.3