#[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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ThemeColor
Source§impl Debug for ThemeColor
impl Debug for ThemeColor
Source§impl<'de> Deserialize<'de> for ThemeColor
impl<'de> Deserialize<'de> for ThemeColor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ThemeColor
Source§impl Hash for ThemeColor
impl Hash for ThemeColor
Source§impl PartialEq for ThemeColor
impl PartialEq for ThemeColor
Source§fn eq(&self, other: &ThemeColor) -> bool
fn eq(&self, other: &ThemeColor) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ThemeColor
impl Serialize for ThemeColor
impl StructuralPartialEq for ThemeColor
Auto Trait Implementations§
impl Freeze for ThemeColor
impl RefUnwindSafe for ThemeColor
impl Send for ThemeColor
impl Sync for ThemeColor
impl Unpin for ThemeColor
impl UnsafeUnpin for ThemeColor
impl UnwindSafe for ThemeColor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.