8000 Removes unnecessary float conversions · matplotlib/matplotlib@dcf9a6e · GitHub
[go: up one dir, main page]

Skip to content

Commit dcf9a6e

Browse files
committed
Removes unnecessary float conversions
1 parent e5700ba commit dcf9a6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/colors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def to_rgba(self, arg, alpha=None):
349349
try:
350350
if not cbook.is_string_like(arg) and cbook.iterable(arg):
351351
if len(arg) == 4:
352-
if any(float(x) < 0. or float(x) > 1. for x in arg):
352+
if any(float(x) < 0 or x > 1 for x in arg):
353353
raise ValueError(
354354
'number in rbga sequence outside 0-1 range')
355355
if alpha is None:
@@ -359,7 +359,7 @@ def to_rgba(self, arg, alpha=None):
359359
return arg[0], arg[1], arg[2], alpha
360360
if len(arg) == 3:
361361
r, g, b = arg
362-
if any(float(x) < 0. or float(x) > 1. for x in arg):
362+
if any(float(x) < 0 or x > 1 for x in arg):
363363
raise ValueError(
364364
'number in rbg sequence outside 0-1 range')
365365
else:

0 commit comments

Comments
 (0)
0