pub struct ThemeDefinition {
pub name: String,
pub display_name: String,
pub base: ThemeBase,
pub colors: ThemeColors,
}Expand description
A custom theme definition from a plugin.
Fields§
§name: StringUnique identifier (e.g., “tokyo-night”)
display_name: StringDisplay name for UI (e.g., “Tokyo Night”)
base: ThemeBaseBase theme to inherit from (“dark” or “light”)
colors: ThemeColorsColor palette
Implementations§
Source§impl ThemeDefinition
impl ThemeDefinition
Sourcepub fn new(
name: impl Into<String>,
display_name: impl Into<String>,
base: ThemeBase,
) -> Self
pub fn new( name: impl Into<String>, display_name: impl Into<String>, base: ThemeBase, ) -> Self
Create a new theme definition with default colors.
Sourcepub fn with_backgrounds(
self,
base: Option<u32>,
surface: Option<u32>,
elevated: Option<u32>,
) -> Self
pub fn with_backgrounds( self, base: Option<u32>, surface: Option<u32>, elevated: Option<u32>, ) -> Self
Set background colors.
Sourcepub fn with_text(
self,
primary: Option<u32>,
secondary: Option<u32>,
muted: Option<u32>,
) -> Self
pub fn with_text( self, primary: Option<u32>, secondary: Option<u32>, muted: Option<u32>, ) -> Self
Set text colors.
Sourcepub fn with_accents(
self,
primary: Option<u32>,
hover: Option<u32>,
muted: Option<u32>,
) -> Self
pub fn with_accents( self, primary: Option<u32>, hover: Option<u32>, muted: Option<u32>, ) -> Self
Set accent colors.
Sourcepub fn with_semantic(
self,
success: Option<u32>,
warning: Option<u32>,
error: Option<u32>,
info: Option<u32>,
) -> Self
pub fn with_semantic( self, success: Option<u32>, warning: Option<u32>, error: Option<u32>, info: Option<u32>, ) -> Self
Set semantic colors.
Sourcepub fn with_chart_palette(self, palette: Vec<u32>) -> Self
pub fn with_chart_palette(self, palette: Vec<u32>) -> Self
Set chart palette.
Trait Implementations§
Source§impl Clone for ThemeDefinition
impl Clone for ThemeDefinition
Source§fn clone(&self) -> ThemeDefinition
fn clone(&self) -> ThemeDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ThemeDefinition
impl RefUnwindSafe for ThemeDefinition
impl Send for ThemeDefinition
impl Sync for ThemeDefinition
impl Unpin for ThemeDefinition
impl UnsafeUnpin for ThemeDefinition
impl UnwindSafe for ThemeDefinition
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> 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