This commit is contained in:
Kovid Goyal 2024-09-30 11:14:32 +05:30
parent 7b4a6e00a7
commit 16d334a4b6
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -1562,7 +1562,7 @@ def transparent_background_colors(spec: str) -> Tuple[Tuple[Color, float], ...]:
for part in spec.split():
col, sep, alpha = part.partition('@')
c = to_color(col)
o = unit_float(alpha) if alpha else -1
o = max(-1, min(float(alpha) if alpha else -1, 1))
if (idx := seen.get(c)) is not None:
ans[idx] = c, o
continue