-
Notifications
You must be signed in to change notification settings - 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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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
Member
|
Looks like these changes broke some part of |
Member
|
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. |
Member
|
Hello, are you planning to continue working on this? |
Collaborator
|
I think i will go about my way doing this in a few days |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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