#[repr(C)]pub struct Theme {
pub seed: Rgb,
pub accent: Option<Rgb>,
pub corner: Corner,
pub density: Density,
pub font: FontFamily,
pub palette: Option<Palette>,
pub type_scale: Option<TypeScale>,
pub shapes: Option<Shapes>,
}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.
Breaking in mobiler-ui 0.29 / mobiler-core 0.40: Theme gained palette (and further
design-release fields follow). Code that lists every field in a Theme { … } literal no longer
compiles. Write Theme { seed, ..Default::default() } and set only what you need.
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: FontFamily§palette: Option<Palette>Explicit colour roles for light and dark (dark_mode picks the set). None = the shell’s
own colours, exactly as before; a role left None inside a set keeps the shell’s colour too.
type_scale: Option<TypeScale>Per-style size, weight and font role (see TypeScale). None, or a style left None, keeps
the shell’s current look for that style.
shapes: Option<Shapes>Per-component corner radii (see Shapes). None, or a component left None, keeps the
shell’s current shape for it.
Trait 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() }.