Created
March 10, 2019 17:15
-
-
Save jaddoescad/03ca13e8ace6a14c31b1d6363ad22d7a to your computer and use it in GitHub Desktop.
coloringequations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ColoringEquations(Scene): | |
#Grouping and coloring parts of equations | |
def construct(self): | |
line1=TexMobject(r"\text{The vector } \vec{F}_{net} \text{ is the net }",r"\text{force }",r"\text{on object of mass }") | |
line1.set_color_by_tex("force", BLUE) | |
line2=TexMobject("m", "\\text{ and acceleration }", "\\vec{a}", ". ") | |
line2.set_color_by_tex_to_color_map({ | |
"m": YELLOW, | |
"{a}": RED | |
}) | |
sentence=VGroup(line1,line2) | |
sentence.arrange_submobjects(DOWN, buff=MED_LARGE_BUFF) | |
self.play(Write(sentence)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment