Simplify chained comparison

This commit is contained in:
Hugo van Kemenade 2022-04-10 17:50:17 +03:00
parent 935bdfa516
commit 74ccda3aff

View File

@ -222,7 +222,7 @@ def _save_all(im, fp, filename):
if (
not isinstance(background, (list, tuple))
or len(background) != 4
or not all(v >= 0 and v < 256 for v in background)
or not all(0 <= v < 256 for v in background)
):
raise OSError(
"Background color is not an RGBA tuple clamped to (0-255): %s"