pub struct Theme {Show 14 fields
pub name: String,
pub primary: (u8, u8, u8),
pub secondary: (u8, u8, u8),
pub accent: (u8, u8, u8),
pub surface: (u8, u8, u8),
pub panel: (u8, u8, u8),
pub background: (u8, u8, u8),
pub foreground: (u8, u8, u8),
pub success: (u8, u8, u8),
pub warning: (u8, u8, u8),
pub error: (u8, u8, u8),
pub dark: bool,
pub luminosity_spread: f64,
pub variables: HashMap<String, TcssColor>,
}Expand description
A semantic theme with named color slots and shade generation.
Colors are stored as (u8, u8, u8) RGB tuples. The resolve method
maps variable names like "primary", "primary-lighten-2", or
"accent-darken-1" to concrete TcssColor::Rgb values.
Fields§
§name: StringThe unique identifier name for this theme (e.g., “textual-dark”).
primary: (u8, u8, u8)Primary brand color used for accented interactive elements.
secondary: (u8, u8, u8)Secondary brand color for supporting UI elements.
accent: (u8, u8, u8)Accent color for highlights and call-to-action elements.
surface: (u8, u8, u8)Surface color for widget backgrounds.
panel: (u8, u8, u8)Panel color for sidebars and container backgrounds.
background: (u8, u8, u8)Main application background color.
foreground: (u8, u8, u8)Default text foreground color.
success: (u8, u8, u8)Color for success/positive state indicators.
warning: (u8, u8, u8)Color for warning/caution state indicators.
error: (u8, u8, u8)Color for error/danger state indicators.
dark: boolWhether this is a dark theme; affects luminosity calculations.
luminosity_spread: f64Luminosity delta per shade step for lighten/darken operations.
variables: HashMap<String, TcssColor>User-defined variable overrides. Checked before computed shades.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more