File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -237,11 +237,11 @@ def __init__(
237
237
raise ValueError (
238
238
f"ManimColor only accepts lists/tuples/arrays of length 3 or 4, not { length } "
239
239
)
240
- elif hasattr (value , ' get_hex' ) and callable (value .get_hex ):
240
+ elif hasattr (value , " get_hex" ) and callable (value .get_hex ):
241
241
result = re_hex .search (value .get_hex ())
242
242
if result is None :
243
243
raise ValueError (f"Failed to parse a color from { value } " )
244
-
244
+
245
245
self ._internal_value = ManimColor ._internal_from_hex_string (
246
246
result .group (), alpha
247
247
)
@@ -359,7 +359,7 @@ def to_hex(self, with_alpha: bool = False) -> str:
359
359
if with_alpha :
360
360
tmp += f"{ int (self ._internal_value [3 ]* 255 ):02X} "
361
361
return tmp
362
-
362
+
363
363
def to_hsv (self ) -> HSV_Array_Float :
364
364
return colorsys .rgb_to_hsv (* self .to_rgb ())
365
365
@@ -388,12 +388,10 @@ def from_rgba(
388
388
@classmethod
389
389
def from_hex (cls , hex : str , alpha : float = 1.0 ) -> ManimColor :
390
390
return cls (hex , alpha )
391
-
391
+
392
392
@classmethod
393
393
def from_hsv (
394
- cls ,
395
- hsv : HSV_Array_Float | HSV_Tuple_Float ,
396
- alpha : float = 1.0
394
+ cls , hsv : HSV_Array_Float | HSV_Tuple_Float , alpha : float = 1.0
397
395
) -> ManimColor :
398
396
rgb = colorsys .hsv_to_rgb (* hsv )
399
397
return cls (rgb , alpha )
You can’t perform that action at this time.
0 commit comments