from manim import *
FONT = "STLiti"
class Demo(Scene):
    def construct(self):
        head = Text("不同颜色的点", font=FONT, font_size=36, color=YELLOW).to_edge(UP, buff=0.6)
        bar = Line(LEFT * 6.6, RIGHT * 6.6, color=BLUE).next_to(head, DOWN, buff=0.12)
        self.play(FadeIn(head), Create(bar), run_time=0.6)
        cols = [("RED", RED), ("GREEN", GREEN), ("BLUE", BLUE),
                ("YELLOW", YELLOW), ("PURPLE", PURPLE)]
        dots = VGroup(*[Dot(radius=0.3, color=c) for _, c in cols]).arrange(RIGHT, buff=1.1)
        caps = VGroup(*[Text(n, font="Consolas", font_size=22, color=c) for n, c in cols])
        for i, cap in enumerate(caps):
            cap.next_to(dots[i], DOWN, buff=0.35)
        for i in range(5):
            self.play(FadeIn(dots[i]), FadeIn(caps[i]), run_time=0.5)
        self.wait(2.5)
