Skip to content

Commit c47b2d5

Browse files
MrDiverJasonGrace2282pre-commit-ci[bot]
authored
Experimenting with an HSV class (#3518)
* Experimenting with an HSL class * Add some more functionality * Adding a lot of tests and implementing fully functional conversion between color spaces over proxy rgba * Fixing tests * Fixing typing * return str to normal * Additional documentation * Update manim/utils/color/core.py Co-authored-by: adeshpande <[email protected]> * Update manim/utils/color/core.py Co-authored-by: adeshpande <[email protected]> * Update manim/utils/color/core.py Co-authored-by: adeshpande <[email protected]> * Update manim/utils/color/core.py Co-authored-by: adeshpande <[email protected]> * Fix documentation and typing and revamp operators to respect color spaces * Fix color operator typing and add operator tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix typeguard * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Import ManimFloat * Update manim/utils/color/core.py Co-authored-by: Aarush Deshpande <[email protected]> * Update manim/utils/color/core.py Co-authored-by: Aarush Deshpande <[email protected]> * Add docstring to _internal_space * naming of functions according to pep8 * Fix naming * Update manim/utils/color/core.py Co-authored-by: Aarush Deshpande <[email protected]> * Update manim/utils/color/core.py Co-authored-by: Aarush Deshpande <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Jason Grace <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2075f82 commit c47b2d5

File tree

3 files changed

+578
-50
lines changed

3 files changed

+578
-50
lines changed

manim/typing.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
"RGBA_Tuple_Int",
4242
"HSV_Array_Float",
4343
"HSV_Tuple_Float",
44+
"HSL_Array_Float",
45+
"HSL_Tuple_Float",
46+
"HSVA_Array_Float",
47+
"HSVA_Tuple_Float",
4448
"ManimColorInternal",
4549
"PointDType",
4650
"InternalPoint2D",
@@ -215,6 +219,46 @@
215219
Brightness) in the represented color.
216220
"""
217221

222+
HSVA_Array_Float: TypeAlias = RGBA_Array_Float
223+
"""``shape: (4,)``
224+
225+
A :class:`numpy.ndarray` of 4 floats between 0 and 1, representing a
226+
color in HSVA (or HSBA) format.
227+
228+
Its components describe, in order, the Hue, Saturation and Value (or
229+
Brightness) in the represented color.
230+
"""
231+
232+
HSVA_Tuple_Float: TypeAlias = RGBA_Tuple_Float
233+
"""``shape: (4,)``
234+
235+
A tuple of 4 floats between 0 and 1, representing a color in HSVA (or
236+
HSBA) format.
237+
238+
Its components describe, in order, the Hue, Saturation and Value (or
239+
Brightness) in the represented color.
240+
"""
241+
242+
HSL_Array_Float: TypeAlias = RGB_Array_Float
243+
"""``shape: (3,)``
244+
245+
A :class:`numpy.ndarray` of 3 floats between 0 and 1, representing a
246+
color in HSL format.
247+
248+
Its components describe, in order, the Hue, Saturation and Lightness
249+
in the represented color.
250+
"""
251+
252+
HSL_Tuple_Float: TypeAlias = RGB_Tuple_Float
253+
"""``shape: (3,)``
254+
255+
A :class:`numpy.ndarray` of 3 floats between 0 and 1, representing a
256+
color in HSL format.
257+
258+
Its components describe, in order, the Hue, Saturation and Lightness
259+
in the represented color.
260+
"""
261+
218262
ManimColorInternal: TypeAlias = RGBA_Array_Float
219263
"""``shape: (4,)``
220264

0 commit comments

Comments
 (0)