forked from LiveCarta/BookConverter
Set correct regex for rgba
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user