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])