-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Deprecate color enum usage and change constants from `str to type Color
#2606
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
BrorSebastianSjovald
wants to merge
9
commits into
ManimCommunity:main
from
DD2480-Group-10:refactor/color-community-ver
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
16ae320
Removed enum from color class and temporary fix to access constant fr…
ludwigjo 63ed75f
Makes color constants instances of Color-class (#9)
amandakrohn 707ce2b
Add deprecation warnings for duplicate color functions (#10)
BrorSebastianSjovald be0efb7
Added deprecation warnings when accessing color enums, fix #8 (#11)
ludwigjo fd26177
Changed `warnings` to `deprecated` decorations
BrorSebastianSjovald 6698ec2
Fixed doctest to new type of constants
BrorSebastianSjovald 254a526
Fixed pre-commit issues
BrorSebastianSjovald 8633335
Removed uneccessary comment in imports
BrorSebastianSjovald 5334848
Added missing import for example
BrorSebastianSjovald File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,14 +35,7 @@ | |||||
|
|
||||||
| from .. import config | ||||||
| from ..constants import * | ||||||
| from ..utils.color import ( | ||||||
| BLACK, | ||||||
| WHITE, | ||||||
| YELLOW_C, | ||||||
| Colors, | ||||||
| color_gradient, | ||||||
| interpolate_color, | ||||||
| ) | ||||||
| from ..utils.color import BLACK, WHITE, YELLOW_C, color_gradient, interpolate_color | ||||||
| from ..utils.exceptions import MultiAnimationOverrideException | ||||||
| from ..utils.iterables import list_update, remove_list_redundancies | ||||||
| from ..utils.paths import straight_path | ||||||
|
|
@@ -1646,7 +1639,7 @@ def put_start_and_end_on(self, start, end): | |||||
|
|
||||||
| # Background rectangle | ||||||
| def add_background_rectangle( | ||||||
| self, color: Optional[Colors] = None, opacity: float = 0.75, **kwargs | ||||||
| self, color: str = None, opacity: float = 0.75, **kwargs | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ): | ||||||
| """Add a BackgroundRectangle as submobject. | ||||||
|
|
||||||
|
|
||||||
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
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
Oops, something went wrong.
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.
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.
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.
Pretty sure that a color object would work fine here too.