Skip to content

Commit 0fb0047

Browse files
Better method, using multiply_alpha
1 parent b729177 commit 0fb0047

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/textual/css/_style_properties.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,15 +984,14 @@ def __set__(self, obj: StylesBase, color: Color | str | None) -> None:
984984
continue
985985
try:
986986
parsed_color = Color.parse(token)
987-
_r, _g, _b, alpha, _, _ = parsed_color
988987
except ColorParseError as error:
989988
raise StyleValueError(
990989
f"Invalid color value '{token}'",
991990
help_text=color_property_help_text(
992991
self.name, context="inline", error=error, value=token
993992
),
994993
)
995-
parsed_color = parsed_color.with_alpha(alpha)
994+
parsed_color = parsed_color.multiply_alpha(alpha)
996995

997996
if obj.set_rule(self.name, parsed_color):
998997
obj.refresh(children=True)

0 commit comments

Comments
 (0)