Skip to content

Commit d18a8dc

Browse files
committed
Merge branch 'color_fix' of github.com:MrDiver/manim into color_fix
2 parents 2befc10 + bbef400 commit d18a8dc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

manim/utils/color/core.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ def __init__(
237237
raise ValueError(
238238
f"ManimColor only accepts lists/tuples/arrays of length 3 or 4, not {length}"
239239
)
240-
elif hasattr(value, 'get_hex') and callable(value.get_hex):
240+
elif hasattr(value, "get_hex") and callable(value.get_hex):
241241
result = re_hex.search(value.get_hex())
242242
if result is None:
243243
raise ValueError(f"Failed to parse a color from {value}")
244-
244+
245245
self._internal_value = ManimColor._internal_from_hex_string(
246246
result.group(), alpha
247247
)
@@ -359,7 +359,7 @@ def to_hex(self, with_alpha: bool = False) -> str:
359359
if with_alpha:
360360
tmp += f"{int(self._internal_value[3]*255):02X}"
361361
return tmp
362-
362+
363363
def to_hsv(self) -> HSV_Array_Float:
364364
return colorsys.rgb_to_hsv(*self.to_rgb())
365365

@@ -388,12 +388,10 @@ def from_rgba(
388388
@classmethod
389389
def from_hex(cls, hex: str, alpha: float = 1.0) -> ManimColor:
390390
return cls(hex, alpha)
391-
391+
392392
@classmethod
393393
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
397395
) -> ManimColor:
398396
rgb = colorsys.hsv_to_rgb(*hsv)
399397
return cls(rgb, alpha)

0 commit comments

Comments
 (0)