pub struct Theme {
pub name: String,
pub is_system: bool,
pub colors: HashMap<ColorName, ThemeColor>,
}Expand description
A theme or color scheme represents a homogeneous combination of colors to applly to an application.
Each color scheme must have a unique name that identifies it.
The default Theme has no defined colors and has is_system set to
true to indicate that it’s a theme that follows the system wide
color scheme.
Fields§
§name: StringUnique name for the theme
is_system: boolIndicates that the Theme has no colors set and therefore follows
the system wide color scheme.
colors: HashMap<ColorName, ThemeColor>Implementations§
Source§impl Theme
impl Theme
pub fn new_from_iter<I: IntoIterator<Item = (ColorName, ThemeColor)>>( name: String, colors: I, ) -> Self
pub fn new(name: String, colors: HashMap<ColorName, ThemeColor>) -> Self
pub fn to_css(&self, variant: ThemeColorVariant) -> String
pub fn get_provider(&self, variant: ThemeColorVariant) -> CssProvider
pub fn action_row(&self) -> ActionRow
Sourcepub fn default_themes() -> Vec<Self>
pub fn default_themes() -> Vec<Self>
Returns a list of built-in themes. Without any additional feature flags this will return an empty list.
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 UnwindSafe for Theme
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)