Skip to content

using color instead of fill_color with MathTeX for node labels#4501

Merged
behackl merged 4 commits intoManimCommunity:mainfrom
Schefflera-Arboricola:issue_4500
Jan 25, 2026
Merged

using color instead of fill_color with MathTeX for node labels#4501
behackl merged 4 commits intoManimCommunity:mainfrom
Schefflera-Arboricola:issue_4500

Conversation

@Schefflera-Arboricola
Copy link
Copy Markdown
Contributor

@Schefflera-Arboricola Schefflera-Arboricola commented Dec 3, 2025

fixes #4500

Overview: What does this pull request change?

Replaced fill_color= with color= in all MathTex() calls throughout the codebase

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

Before: MathTex("x^2", fill_color=BLACK) --> white text
After: MathTex("x^2", color=BLACK) --> black text

white node labels on white node --> labels were not visible.

Links to added or changed documentation pages

https://manimce--4501.org.readthedocs.build/en/4501/reference/manim.mobject.graph.Graph.html -- here you can see the labels showing up in the examples (LabeledModifiedGraph example)

Further Information and Comments

NA

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

@Schefflera-Arboricola Schefflera-Arboricola marked this pull request as ready for review December 3, 2025 21:00
Copy link
Copy Markdown
Member

@behackl behackl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing this fix! I've investigated and found that passing fill_color to MathTex objects doesn't work as expected — the class hierarchy doesn't properly propagate fill_color to the LaTeX-rendered submobjects. This is a separate underlying issue that we'll address in a future PR.

For now, your fix using color= instead of fill_color= is the correct approach. Using color is semantically more appropriate for text objects (you want to color the text, not fill a shape).

Happy to merge this as a targeted fix!

@behackl behackl added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Jan 25, 2026
@behackl behackl merged commit eca7f17 into ManimCommunity:main Jan 25, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

Graph: node labels' color defaulting to white instead of black

2 participants