From 5f0560fe59194a39ec85ac18b1f21a88699ca543 Mon Sep 17 00:00:00 2001 From: Kiryl Date: Wed, 21 Sep 2022 20:08:33 +0300 Subject: [PATCH] Set correct regex for rgba --- src/util/color_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/color_reader.py b/src/util/color_reader.py index 92b3ee7..31bab3b 100644 --- a/src/util/color_reader.py +++ b/src/util/color_reader.py @@ -103,7 +103,7 @@ def str2hex(s: str) -> str: return rgb_percent_to_hex((r, g, b)) if "rgb" in s.lower(): - rgba = re.findall("([0-9] *\.?[0-9]+)", s) + rgba = re.findall("(\d+(?:\.\d+)?)", s) r, g, b = int(rgba[0]), int(rgba[1]), int(rgba[2]) if len(rgba) == 4: alpha = float(rgba[3])