ratatui_toolkit/services/theme/theme_variant/
mod.rs

1//! Theme variant module for light and dark mode support.
2//!
3//! This module provides the [`ThemeVariant`] enum which represents whether
4//! to use dark or light mode colors from a theme definition.
5//!
6//! # Example
7//!
8//! ```rust
9//! use ratatui_toolkit::services::theme::ThemeVariant;
10//!
11//! let variant = ThemeVariant::Dark;
12//! assert_eq!(variant, ThemeVariant::Dark);
13//!
14//! let light = ThemeVariant::Light;
15//! assert_eq!(light, ThemeVariant::Light);
16//! ```
17
18/// Represents the color scheme variant for a theme.
19///
20/// Themes typically define two sets of colors - one optimized for dark
21/// backgrounds and one for light backgrounds. This enum allows selecting
22/// which set to use.
23///
24/// # Variants
25///
26/// * `Dark` - Use colors optimized for dark backgrounds (light text on dark)
27/// * `Light` - Use colors optimized for light backgrounds (dark text on light)
28#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
29pub enum ThemeVariant {
30    /// Dark mode colors - light text on dark background.
31    ///
32    /// This is typically the default for terminal applications.
33    #[default]
34    Dark,
35
36    /// Light mode colors - dark text on light background.
37    ///
38    /// Suitable for terminals with light backgrounds or when
39    /// matching a light system theme.
40    Light,
41}
42
43mod traits;