pub struct Theme {
pub meta: ThemeMeta,
/* private fields */
}Expand description
A resolved theme with all tokens and styles ready for use.
Fields§
§meta: ThemeMetaTheme metadata.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn color(&self, token: &str) -> ThemeColor
pub fn color(&self, token: &str) -> ThemeColor
Get a color by token name.
Falls back to ThemeColor::FALLBACK if the token is not found.
Sourcepub fn style(&self, name: &str) -> ThemeStyle
pub fn style(&self, name: &str) -> ThemeStyle
Get a style by name.
Returns a default (empty) style if not found.
Sourcepub fn gradient(&self, name: &str, t: f32) -> ThemeColor
pub fn gradient(&self, name: &str, t: f32) -> ThemeColor
Get a gradient color at position t (0.0 to 1.0).
Falls back to ThemeColor::FALLBACK if the gradient is not found.
Sourcepub fn get_gradient(&self, name: &str) -> Option<&Gradient>
pub fn get_gradient(&self, name: &str) -> Option<&Gradient>
Get a gradient by name for manual interpolation.
Sourcepub fn has_gradient(&self, name: &str) -> bool
pub fn has_gradient(&self, name: &str) -> bool
Check if a gradient exists.
Sourcepub fn token_names(&self) -> Vec<&str>
pub fn token_names(&self) -> Vec<&str>
Get all token names.
Sourcepub fn style_names(&self) -> Vec<&str>
pub fn style_names(&self) -> Vec<&str>
Get all style names.
Sourcepub fn gradient_names(&self) -> Vec<&str>
pub fn gradient_names(&self) -> Vec<&str>
Get all gradient names.
Sourcepub fn builtin_neon() -> Self
pub fn builtin_neon() -> Self
Load the builtin SilkCircuit Neon theme.
Trait Implementations§
Source§impl ThemeCliExt for Theme
impl ThemeCliExt for Theme
Source§impl ThemeColorExt for Theme
impl ThemeColorExt for Theme
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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