Skip to main content
A theme centralizes named colors and applies default styles by element type and by classname. Build one with create_theme, then attach it per page or document wide.

Creating a theme

The optional definition holds a colors map of named colors, along with other optional fields.

Applying a theme

Apply a theme document wide with set_theme, or pass it to a single page through create_page.

Reading colors

theme.get_color returns a registered color by name. Use it anywhere a color is accepted.
Define every brand color once in create_theme, then reference it with get_color so a single edit updates the whole document.

Elements

Apply theme colors to text, rectangles, and images.

Overview

The Document and Page classes and the build pipeline.