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

ASPECT_RATIO = 16.0 / 9.0
FRAME_HEIGHT = 8.0
FRAME_WIDTH = FRAME_HEIGHT * ASPECT_RATIO
FRAME_Y_RADIUS = FRAME_HEIGHT / 2
FRAME_X_RADIUS = FRAME_WIDTH / 2

DEFAULT_PIXEL_HEIGHT = 1080
DEFAULT_PIXEL_WIDTH = 1920
DEFAULT_FPS = 30

Buffs

SMALL_BUFF = 0.1
MED_SMALL_BUFF = 0.25
MED_LARGE_BUFF = 0.5
LARGE_BUFF = 1

DEFAULT_MOBJECT_TO_EDGE_BUFFER = MED_LARGE_BUFF    # Distance between object and edge
DEFAULT_MOBJECT_TO_MOBJECT_BUFFER = MED_SMALL_BUFF # Distance between objects

Run times

DEFAULT_POINTWISE_FUNCTION_RUN_TIME = 3.0
DEFAULT_WAIT_TIME = 1.0

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
DEGREES = TAU / 360

Text

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

Stroke width

DEFAULT_STROKE_WIDTH = 4

Colours

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