Skip to content

Conversation

barollet
Copy link
Contributor

@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

@github-project-automation github-project-automation bot moved this to 🆕 New in Dev Board May 1, 2025
@barollet barollet marked this pull request as ready for review August 27, 2025 09:44
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