Skip to content

Experimental colors #4233

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

Draft
wants to merge 6 commits into
base: experimental
Choose a base branch
from

Conversation

barollet
Copy link

@barollet barollet commented May 1, 2025

Overview: What does this pull request change?

It removes color attributs from Mobject and OpenGLMobject and fully delegates it to the vectorized child.
Some code is factored into a new ManimColorArray class in the color core file. This class handles creating and updating arrays of colors and opacity regardless of wether a single argument, list or no argument are given for opacity and color. Color and opacity attributes are now instances of this class instead of two separate attributes.
The get_colors and get_opacities variants are modified to access this new attribute so the change is not breaking if we keep using the getters and not direct attribute access.

Motivation and Explanation: Why and how do your changes improve the library?

Mobject is a baseclass where instances are not supposed to be displayed so color attributes do not belong here.

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

2 participants