-
Couldn't load subscription status.
- Fork 2.5k
Simplifying Manim's color handling #2605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Converts values in setting_args dict in _get_settings_from_t2xs to string to make sure that all values are of type string. * Makes color constants instances of Color-class from colour-module and updates color_gradient to handle gradient with one color, fixes #7.
* Removed `color_to_rgb` from `vector_field.py`, feat #4 * Removed usage of `color_to_rgb` from `color.py`, feat #4 * Removed usage of `color_to_rgb` from `opengl_mobject.py`, feat #4 * Fixed `probability.py` to use `Color` instead of `str`, fix #4 * Remove usage of `rgb_to_hex` from `opengl_mobject.py`, feat #4 * Removed usage of `rgb_to_hex` from `opengl_vectorized_mobject.py`, feat #4 * Remove usage of `rgb_to_hex` in `style_utils.py`, fix #4
|
Looks like these changes broke some part of |
|
I've converted this into a draft for now. Feel free to unconvert once the docbuild passes, and let us know if you need any help. |
|
Hello, are you planning to continue working on this? |
|
I think i will go about my way doing this in a few days |
Overview: What does this pull request change?
This PR improves the color handling by removing uses of the
Colorsclass and replace usage of the Enums with color constants as specified in #2451 . At this point, a deprecation warning is raised when trying to use theColorsclass usingmanim.utils.deprecation.Some of the functions previously defined in
color.pythat has existing functionality in thecolourmodule has also been replaced.For instance:
rgb_to_hex()has been replaced byrgb2hex().Motivation and Explanation: Why and how do your changes improve the library?
The overall goal is to simplify the use of color by standardizing the approach as stated in #2451 . By deprecating the use of the Enums and providing a way of using the constants in a similar way, we're creating a standard for how colors should be used.
Links to added or changed documentation pages
Further Information and Comments
Reviewer Checklist