Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Manim Text does not bilink. The error i get is "'c^' is not a recognized color"

class FlashAnimationEffect(Scene):
    def construct(self):
        tex= Text("E","=","m","c^","2").scale(2)
        self.play(Write(tex))
        self.wait()
        
        self.play(Flash(tex[1],flash_radius=0.6),run_time=2)
        self.wait()

The Error says that ‘c^’ is not a recognized color. When I delete c^ the next error is the same but with "2". Thanks for your time and your answer

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You are using Text() to create your text, but this object does not accept several strings as arguments (only the first one is considererd the text to render, and the others are considered other arguments, in particular the fourth one is expected to be the color, hence your error).

You probably wanted to use Tex() or MathTex(). This one works:

class Test(Scene):
    def construct(self):
        tex= MathTex("E","=","m","c^","2").scale(2)
        self.play(Write(tex))
        self.wait()
        
        self.play(Flash(tex[1], flash_radius=0.6),run_time=2)
        self.wait()

Result

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading