-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Adding :class: ManimColor to manim and converting all types #3020
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is TypeAlias
Python 3.10+ only? I'd perhaps be fine with deprecating Python 3.7, but skipping everything until 3.10 is somewhat inconvenient. :-)
I think it was more about the reuse of all the lists in ManimColor and ParsableManimColor And yes TypeAlias is only 3.10 that's why I didn't use it directly but you can still do it without typing |
Ah yes forgot about that, but indeed it can still be done without it (e.g. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
for more information, see https://pre-commit.ci
For the record, #3264 introduces a new file and also a new class which could use the |
67772a8
to
e1c8419
Compare
Already ✅ done thank you for the info! that was very helpful to know! |
There are 2 Todos still remaining, one is the fixing of the color structure passing down colors through constructors and making sure that there are sane default values for everything but it seems to work fine because labeled.py worked flawless without any changes. The other one with the gradient is just some issue that we kind of also had before, because we just didn't have a good implementation. I just referenced the other function for now. So it can safely be done at a later stage.
In which file do we have this ?
|
|
||
""" | ||
|
||
from .core import ManimColor |
Check notice
Code scanning / CodeQL
Cyclic import
|
||
from . import AS2700, BS381, X11, XKCD | ||
from .core import * | ||
from .manim_colors import * |
Check notice
Code scanning / CodeQL
'import *' may pollute namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very happy to finally get a sane(r) color model into the library. Thanks to everyone who was involved here, and in particular @MrDiver! 👏
Overview: What does this pull request change?
This pull request aims to remove all the duplicates of color handling in Manim and unify all colors under one Color type named
ManimColor
and a TypeAliasParsableManimColor
which represents all types that can be converted to aManimColor
Motivation and Explanation: Why and how do your changes improve the library?
Links to added or changed documentation pages
Further Information and Comments
Reviewer Checklist
closes #2837