#[non_exhaustive]pub enum ThemeColor {
Show 19 variants
Primary,
Secondary,
Accent,
Text,
TextDim,
Border,
Bg,
Success,
Warning,
Error,
SelectedBg,
SelectedFg,
Surface,
SurfaceHover,
SurfaceText,
Info,
Link,
FocusRing,
Custom(Color),
}Expand description
Semantic color token that resolves against the active Theme.
Use this when you want colors to automatically follow theme changes
without hardcoding specific Color values. Resolve with
Theme::resolve or crate::Context::color.
§Example
use slt::{Theme, ThemeColor};
let theme = Theme::dark();
let color = theme.resolve(ThemeColor::Primary);
assert_eq!(color, theme.primary);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Primary
Primary accent color.
Secondary
Secondary accent color.
Accent
Decorative accent color.
Text
Default text color.
TextDim
Dimmed text color.
Border
Border color for unfocused containers.
Bg
Background color.
Success
Success indicator color.
Warning
Warning indicator color.
Error
Error indicator color.
SelectedBg
Selected item background.
SelectedFg
Selected item foreground.
Surface
Surface background for elevated containers.
SurfaceHover
Surface hover state.
SurfaceText
Text color readable on surface backgrounds.
Info
Informational indicator (resolves to primary).
Link
Hyperlink color (resolves to primary).
FocusRing
Focus ring outline color (resolves to primary).
Custom(Color)
A literal color value, not resolved from the theme.
Trait Implementations§
Source§impl Clone for ThemeColor
impl Clone for ThemeColor
Source§fn clone(&self) -> ThemeColor
fn clone(&self) -> ThemeColor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more