Module app_theme

Module app_theme 

Source
Available on crate feature theme only.
Expand description

Application theme module for comprehensive TUI theming.

This module provides AppTheme which is the main theme struct that contains all colors needed for a complete TUI application, including UI colors, text colors, background colors, border colors, and specialized color sets for diffs, markdown, and syntax highlighting.

§Color Categories

The theme is organized into logical categories:

  • UI Colors: primary, secondary, accent, error, warning, success, info
  • Text Colors: text, text_muted, selected_text
  • Background Colors: background, background_panel, background_element, background_menu
  • Border Colors: border, border_active, border_subtle
  • Specialized: DiffColors, MarkdownColors, SyntaxColors

§Loading Themes

Themes can be loaded from JSON files in the opencode format using the loader module.

§Example

use ratatui_toolkit::services::theme::{AppTheme, ThemeVariant};

// Use default theme
let theme = AppTheme::default();

// Access UI colors
let primary = theme.primary;
let error = theme.error;

// Access specialized colors
let diff_added = theme.diff.added;
let heading_color = theme.markdown.heading;

Structs§

AppTheme
Comprehensive application theme with all widget colors.