3838 ColourLike = Union [Colour , str , int ]
3939
4040
41- def _coerce_colour (value : " ColourLike" ) -> str :
41+ def _coerce_colour (value : ColourLike ) -> str :
4242 if isinstance (value , Colour ):
4343 return f"{ value .value :0>6x} "
4444 if isinstance (value , int ):
4545 return f"{ value :0>6x} "
4646 if isinstance (value , str ):
4747 stripped = value .lstrip ("#" )
48- if len (stripped ) != 6 or any (c not in "0123456789abcdefABCDEF" for c in stripped ):
48+ if len (stripped ) != 6 or any (
49+ c not in "0123456789abcdefABCDEF" for c in stripped
50+ ):
4951 raise ValueError (
5052 f"{ value !r} is not a valid hexadecimal color (expected format: 'rrggbb')"
5153 )
5254 return stripped .lower ()
53- raise TypeError (
54- f"colors must be Colour, str, or int, not { type (value ).__name__ } "
55- )
55+ raise TypeError (f"colors must be Colour, str, or int, not { type (value ).__name__ } " )
5656
5757
5858class SharedClientTheme :
@@ -80,7 +80,7 @@ class SharedClientTheme:
8080
8181 def __init__ (
8282 self ,
83- colors : Iterable [" ColourLike" ],
83+ colors : Iterable [ColourLike ],
8484 * ,
8585 gradient_angle : int ,
8686 base_mix : int ,
@@ -105,9 +105,7 @@ def __init__(
105105 if base_theme is not None and not isinstance (
106106 base_theme , SharedClientThemeBaseType
107107 ):
108- raise TypeError (
109- "base_theme must be a SharedClientThemeBaseType or None"
110- )
108+ raise TypeError ("base_theme must be a SharedClientThemeBaseType or None" )
111109
112110 self .colors : list [str ] = normalized
113111 self .gradient_angle : int = gradient_angle
0 commit comments