Search code examples
manim

Change Text Colour Manim Community


I have been trying out Manim Community. I am wondering if there is a way to change the text colour to black through out the whole program by calling config.

I can change the background colour using config.background_color = WHITE. I have tried searching online and trying random things (like config.text_colour = BLACK) to no avail. Thanks!


Solution

  • On Mac, I found the file at: /users/<accountName>/library/python/3.8/lib/python/site-packages/manim/svg/text_mobject.py. On Windows, it was found to be here: C:\Users\<accountName>\AppData\Local\Programs\Python\Python38\Lib\site-packages\manim\mobject\svg\text_mobject.py Then, text_mobject.py, I did two/three things:

    1. In line 68, there is this: from ...utils.color import WHITE, Colors. I added from ...utils.color import BLACK, Colors underneath. It gave me an error if I skipped this step.

    2. I went to line 129 and changed color=WHITE to color=BLACK.

    3. Only needed on Windows: Go to line 699 and color: str = WHITE, to color: str = BLACK, Credit for helping me find this goes to olirwin in the comments.

    Note: I am using Manim Community v0.4