manim.utils.color.Colors

class Colors(value)[source]

Bases: enum.Enum

A list of pre-defined colors.

Examples

Example: ColorExample

../_images/ColorExample-2.png
from manim import *

from manim.utils.color import Colors
class ColorExample(Scene):
    def construct(self):
        cols = Colors._member_names_
        s = VGroup(*[Line(DOWN, UP, stroke_width=15).set_color(Colors[cols[i]].value) for i in range(0, len(cols))])
        s.arrange_submobjects(buff=0.2)
        self.add(s)

The preferred way of using these colors is

>>> import manim.utils.color as C
>>> C.WHITE
'#FFFFFF'

Note this way uses the name of the colors in UPPERCASE.

Alternatively, you can also import this Enum directly and use its members directly, through the use of color.value. Note this way uses the name of the colors in lowercase.

>>> from manim.utils.color import Colors
>>> Colors.white.value
'#FFFFFF'

Attributes

black

blue_a

blue_b

blue_c

blue_d

blue_e

dark_blue

dark_brown

dark_grey

darker_grey

gold_a

gold_b

gold_c

gold_d

gold_e

gray

green_a

green_b

green_c

green_d

green_e

green_screen

grey_a

grey_brown

light_brown

light_gray

light_pink

maroon_a

maroon_b

maroon_c

maroon_d

maroon_e

orange

pink

purple_a

purple_b

purple_c

purple_d

purple_e

red_a

red_b

red_c

red_d

red_e

teal_a

teal_b

teal_c

teal_d

teal_e

white

yellow_a

yellow_b

yellow_c

yellow_d

yellow_e