Skip to main content

Module theme

Module theme 

Source
Expand description

Theme system with semantic color slots. Theme system with semantic color slots.

A Theme provides semantic color slots that map to actual colors. This enables consistent styling and easy theme switching (light/dark mode, custom themes).

§Example

use ftui_style::theme::{Theme, AdaptiveColor};
use ftui_style::color::Color;

// Use the default dark theme
let theme = Theme::default();
let text_color = theme.text.resolve(true); // true = dark mode

// Create a custom theme
let custom = Theme::builder()
    .text(Color::rgb(200, 200, 200))
    .background(Color::rgb(20, 20, 20))
    .build();

Modules§

themes
Built-in theme presets.

Structs§

ResolvedTheme
A theme with all colors resolved to fixed values.
SharedResolvedTheme
Wait-free shared resolved theme for concurrent read/write.
Theme
A theme with semantic color slots.
ThemeBuilder
Builder for creating custom themes.

Enums§

AdaptiveColor
An adaptive color that can change based on light/dark mode.