Theme

Struct Theme 

Source
pub struct Theme {
Show 15 fields pub primary_color: Color, pub secondary_color: Color, pub accent_color: Color, pub background_color: Color, pub text_color: Color, pub border_color: Color, pub success_color: Color, pub warning_color: Color, pub error_color: Color, pub info_color: Color, pub spacing: SpacingScale, pub typography: TypographyScale, pub shadows: ShadowScale, pub borders: BorderScale, pub animations: AnimationScale,
}
Expand description

Main theme structure according to API documentation

Fields§

§primary_color: Color§secondary_color: Color§accent_color: Color§background_color: Color§text_color: Color§border_color: Color§success_color: Color§warning_color: Color§error_color: Color§info_color: Color§spacing: SpacingScale§typography: TypographyScale§shadows: ShadowScale§borders: BorderScale§animations: AnimationScale

Implementations§

Source§

impl Theme

Source

pub fn new() -> Self

Creates a new theme with default values

Source

pub fn primary_color(self, color: Color) -> Self

Sets the primary color for the theme

Source

pub fn secondary_color(self, color: Color) -> Self

Sets the secondary color for the theme

Source

pub fn accent_color(self, color: Color) -> Self

Sets the accent color for the theme

Source

pub fn background_color(self, color: Color) -> Self

Sets the background color for the theme

Source

pub fn text_color(self, color: Color) -> Self

Sets the text color for the theme

Source

pub fn apply_to_component(&self, component: &dyn ThemedComponent) -> String

Applies theme to a component

Trait Implementations§

Source§

impl Default for Theme

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.