Skip to content

Commit c44ae00

Browse files
authored
Merge pull request #30153 from emmanuel-ferdman/main
Throw exception when alpha is out of bounds
2 parents 5f922ff + 0ee8e81 commit c44ae00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def with_alpha(self, alpha):
949949
if not isinstance(alpha, Real):
950950
raise TypeError(f"'alpha' must be numeric or None, not {type(alpha)}")
951951
if not 0 <= alpha <= 1:
952-
ValueError("'alpha' must be between 0 and 1, inclusive")
952+
raise ValueError("'alpha' must be between 0 and 1, inclusive")
953953
new_cm = self.copy()
954954
if not new_cm._isinit:
955955
new_cm._init()

0 commit comments

Comments
 (0)