Skip to content

Theming API Reference

Reference for theme management and customization.

Theme Class

The Theme class represents a presentation theme.

from slidegen.theming import Theme

# Default theme
theme = Theme.default()

# Load from template
theme = load_theme(theme_path="template.pptx")

# Load by name
theme = load_theme(theme_name="corporate")

load_theme()

Load a theme from a template file or by name.

from slidegen.theming import load_theme

theme = load_theme(theme_path: Optional[str] = None, theme_name: Optional[str] = None)

Parameters:

  • theme_path (Optional[str]): Path to PowerPoint template file (.pptx)
  • theme_name (Optional[str]): Built-in theme name

Returns:

  • Theme: Theme object

Example:

# Load from template
theme = load_theme(theme_path="templates/corporate.pptx")

# Load built-in theme
theme = load_theme(theme_name="corporate")

Theme Methods

get_background_rgb() -> Optional[RGBColor]

Get background color as RGB color object.

theme = Theme.default()
bg_color = theme.get_background_rgb()

get_text_color() -> Optional[RGBColor]

Get text color as RGB color object.

theme = Theme.default()
text_color = theme.get_text_color()

Built-in Themes

Default Theme

theme = Theme.default()

Professional default appearance with standard colors and fonts.

Corporate Theme

theme = load_theme(theme_name="corporate")

Business-appropriate color scheme and styling.

Dark Theme

theme = load_theme(theme_name="dark")

Dark color scheme for modern presentations.

Using Themes with SlideGenerator

from slidegen import SlideGenerator

# Built-in theme
gen = SlideGenerator(theme_name="corporate")

# Custom template
gen = SlideGenerator(theme="templates/custom.pptx")

See Also