-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add darker, lighter and contrasting methods to ManimColor #3992
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.
- I liked darker and lighter methods. Doing only one thing.
- Contrasting is more problematic because it clearly is a solution for very spesific problem around texts. It does not actually calculate true contrasting/complementary color which is default expectation from that name. Something like
text_color()
would be better.
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.
Thank you for your contribution! I've just left a bunch of minor comments; mainly concerning the use of pre-existing color constants and minor improvements to the documentaiton.
Otherwise, these changes are perfectly fine (and very useful)! Please take a look and let us know what you think!
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.
LGTM, thanks for your efforts!
@behackl Thanks, I've responded to your comments in their own threads, let me know if I need to make any more changes, otherwise I'll probably need to squash and rebase? |
We'll take it from here, I'll run tests one more time locally and then merge it. |
Thanks again for your contribution! 🚀 |
Overview
This adds 3 new methods on
ManimColor
s:darker()
,lighter()
andcontrasting()
, which return new colors.Motivation
This is useful to derive related colors from a base color, for example to write a function that builds VMobjects with some fill color, a slightly darker border, and an inset text in a contrasting color, all that from a single color parameter instead of 3:
Here's a slightly more exhaustive example:
Generated by this Scene: