mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
* Add unit tests for module-level color helpers in manim/utils/color/core.py Adds tests/module/utils/test_color_helpers.py covering the standalone helper functions exported from manim.utils.color.core (color_to_rgb, color_to_rgba, color_to_int_rgb, color_to_int_rgba, rgb_to_color, rgba_to_color, rgb_to_hex, hex_to_rgb, invert_color, color_gradient, interpolate_color, average_color, random_bright_color, random_color) and the RandomColorGenerator class. Before this PR, only the ManimColor class itself was tested (via tests/module/utils/test_manim_color.py); the standalone helpers had zero direct test coverage. Coverage on manim/utils/color/core.py goes from 71% to 80% (line+branch), and 17 of the 18 testable symbols in the file's __all__ are now exercised. The only deferred symbol is get_shaded_rgb, which concerns lighting math rather than color conversion and is better suited to a follow-up. 42 tests, ~0.3s runtime, no new dependencies. Co-authored-by: LetMarq <LetMarq@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update tests/module/utils/test_color_helpers.py Increased assertion scheme to cover all colors. Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com> --------- Co-authored-by: THE-RAF <THE-RAF@users.noreply.github.com> Co-authored-by: LetMarq <LetMarq@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| _split_matrices.py | ||
| _subdivision_matrices.py | ||
| test_bezier.py | ||
| test_color.py | ||
| test_color_helpers.py | ||
| test_deprecation.py | ||
| test_file_ops.py | ||
| test_hashing.py | ||
| test_manim_color.py | ||
| test_space_ops.py | ||
| test_tex.py | ||
| test_units.py | ||