#[repr(C)]pub struct Theme {
pub seed: Rgb,
pub accent: Option<Rgb>,
pub corner: Corner,
pub density: Density,
pub font: FontFamily,
}Expand description
App branding as data — the visual twin of dark_mode. Set on a Widget::Scaffold
(theme: None = the framework defaults, i.e. no visual change). The shell maps these
to its native theming: seed → the brand/primary color (Android M3 scheme / iOS tint /
web --primary), plus a global corner, spacing, and font choice.
Fields§
§seed: Rgb§accent: Option<Rgb>Optional secondary brand color. None ⇒ derived from seed. Used for the
gradient on CardStyle::Brand (seed → accent) and as a secondary accent.
corner: Corner§density: Density§font: FontFamilyTrait Implementations§
impl Copy for Theme
Source§impl Default for Theme
Theme::default() matches the framework’s un-themed look as closely as a theme can
(medium corners, comfortable spacing, system font) with a neutral indigo seed — so an
app can override just the bits it cares about: Theme { seed: brand, ..Default::default() }.
impl Default for Theme
Theme::default() matches the framework’s un-themed look as closely as a theme can
(medium corners, comfortable spacing, system font) with a neutral indigo seed — so an
app can override just the bits it cares about: Theme { seed: brand, ..Default::default() }.
Source§impl<'de> Deserialize<'de> for Theme
impl<'de> Deserialize<'de> for Theme
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Theme, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Theme, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Theme
Source§impl Serialize for Theme
impl Serialize for Theme
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq 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 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
Mutably borrows from an owned value. Read more