@@ -799,7 +799,7 @@ def is_valid_rgba(cls, color: AnyRgba, /, *, allow_alpha: bool = True) -> bool:
799799 and len (array_color ) == 4
800800 and all (isinstance (val , int ) for val in array_color [:3 ])
801801 and isinstance (array_color [3 ], (float , type (None )))
802- ):
802+ ):
803803 return (
804804 0 <= array_color [0 ] <= 255 and 0 <= array_color [1 ] <= 255 and 0 <= array_color [2 ] <= 255
805805 and (array_color [3 ] is None or 0 <= array_color [3 ] <= 1 )
@@ -816,7 +816,7 @@ def is_valid_rgba(cls, color: AnyRgba, /, *, allow_alpha: bool = True) -> bool:
816816 and len (dict_color ) == 4
817817 and all (isinstance (dict_color .get (ch ), int ) for ch in ("r" , "g" , "b" ))
818818 and isinstance (dict_color .get ("a" , "no alpha" ), (float , type (None )))
819- ):
819+ ):
820820 return (
821821 0 <= dict_color ["r" ] <= 255 and 0 <= dict_color ["g" ] <= 255 and 0 <= dict_color ["b" ] <= 255
822822 and (dict_color ["a" ] is None or 0 <= dict_color ["a" ] <= 1 )
@@ -850,7 +850,7 @@ def is_valid_hsla(cls, color: AnyHsla, /, *, allow_alpha: bool = True) -> bool:
850850 and len (array_color ) == 4
851851 and all (isinstance (val , int ) for val in array_color [:3 ])
852852 and isinstance (array_color [3 ], (float , type (None )))
853- ):
853+ ):
854854 return (
855855 0 <= array_color [0 ] <= 360 and 0 <= array_color [1 ] <= 100 and 0 <= array_color [2 ] <= 100
856856 and (array_color [3 ] is None or 0 <= array_color [3 ] <= 1 )
@@ -867,7 +867,7 @@ def is_valid_hsla(cls, color: AnyHsla, /, *, allow_alpha: bool = True) -> bool:
867867 and len (dict_color ) == 4
868868 and all (isinstance (dict_color .get (ch ), int ) for ch in ("h" , "s" , "l" ))
869869 and isinstance (dict_color .get ("a" , "no alpha" ), (float , type (None )))
870- ):
870+ ):
871871 return (
872872 0 <= dict_color ["h" ] <= 360 and 0 <= dict_color ["s" ] <= 100 and 0 <= dict_color ["l" ] <= 100
873873 and (dict_color ["a" ] is None or 0 <= dict_color ["a" ] <= 1 )
0 commit comments