constants

The constants.py in the manimlib folder defines the constants needed when running manim. Some constants are not explained here because they are only used inside manim.

Frame and pixel shape

These values will be determined based on the camera configuration in default_config.yml or custom_config.yml

ASPECT_RATIO
FRAME_HEIGHT
FRAME_WIDTH
FRAME_Y_RADIUS
FRAME_X_RADIUS

DEFAULT_PIXEL_HEIGHT
DEFAULT_PIXEL_WIDTH
DEFAULT_FPS

Buffs

These values will be determined based on the size configuration in default_config.yml or custom_config.yml

SMALL_BUFF
MED_SMALL_BUFF
MED_LARGE_BUFF
LARGE_BUFF

DEFAULT_MOBJECT_TO_EDGE_BUFF
DEFAULT_MOBJECT_TO_MOBJECT_BUFF

Coordinates

manim uses three-dimensional coordinates and uses the type of ndarray

ORIGIN = np.array((0., 0., 0.))
UP = np.array((0., 1., 0.))
DOWN = np.array((0., -1., 0.))
RIGHT = np.array((1., 0., 0.))
LEFT = np.array((-1., 0., 0.))
IN = np.array((0., 0., -1.))
OUT = np.array((0., 0., 1.))
X_AXIS = np.array((1., 0., 0.))
Y_AXIS = np.array((0., 1., 0.))
Z_AXIS = np.array((0., 0., 1.))

# Useful abbreviations for diagonals
UL = UP + LEFT
UR = UP + RIGHT
DL = DOWN + LEFT
DR = DOWN + RIGHT

TOP = FRAME_Y_RADIUS * UP
BOTTOM = FRAME_Y_RADIUS * DOWN
LEFT_SIDE = FRAME_X_RADIUS * LEFT
RIGHT_SIDE = FRAME_X_RADIUS * RIGHT

Mathematical constant

PI = np.pi
TAU = 2 * PI
DEG = TAU / 360

Text

NORMAL = "NORMAL"
ITALIC = "ITALIC"
OBLIQUE = "OBLIQUE"
BOLD = "BOLD"

Colours

Color constants are determined based on the color configuration in default_config.yml or custom_config.yml

Here are the preview of default colours. (Modified from elteoremadebeethoven)

BLUE

BLUE_E

BLUE_D

BLUE_C

BLUE_B

BLUE_A

TEAL

TEAL_E

TEAL_D

TEAL_C

TEAL_B

TEAL_A

GREEN

GREEN_E

GREEN_D

GREEN_C

GREEN_B

GREEN_A

YELLOW

YELLOW_E

YELLOW_D

YELLOW_C

YELLOW_B

YELLOW_A

GOLD

GOLD_E

GOLD_D

GOLD_C

GOLD_B

GOLD_A

RED

RED_E

RED_D

RED_C

RED_B

RED_A

MAROON

MAROON_E

MAROON_D

MAROON_C

MAROON_B

MAROON_A

PURPLE

PURPLE_E

PURPLE_D

PURPLE_C

PURPLE_B

PURPLE_A

GREY

GREY_E

GREY_D

GREY_C

GREY_B

GREY_A

Others

WHITE

BLACK

GREY_BROWN

DARK_BROWN

LIGHT_BROWN

PINK

LIGHT_PINK

GREEN_SCREEN

ORANGE