pub struct Theme<'a, C: PixelColor> {Show 16 fields
pub background: Container<C>,
pub primary: Container<C>,
pub secondary: Container<C>,
pub button: Component<C>,
pub accent: Component<C>,
pub destructive: Component<C>,
pub success: Component<C>,
pub warning: Component<C>,
pub text_button: Component<C>,
pub icon_button: Component<C>,
pub palette: Palette<C>,
pub spacing: Spacing,
pub corner_radii: CornerRadii,
pub typography: Typography<'a>,
pub is_dark: bool,
pub is_high_contrast: bool,
}Expand description
Top-level theme. The application owns one and passes it down to widgets at draw time.
Widgets do not reach into the per-role component fields directly —
they go through the catalog traits (ButtonCatalog, etc.), so changing
the palette doesn’t ripple through every widget implementation.
Fields§
§background: Container<C>Background region (the outermost layer behind everything).
primary: Container<C>Primary content region.
secondary: Container<C>Secondary panel/sidebar region.
Standard button.
accent: Component<C>Accent / suggested-action.
destructive: Component<C>Destructive (red).
success: Component<C>Success (green).
warning: Component<C>Warning (yellow/orange).
Text-only / ghost button.
Icon-only button.
palette: Palette<C>Named palette colors the rest of the theme is derived from.
spacing: SpacingSpacing scale.
corner_radii: CornerRadiiCorner-radius scale.
typography: Typography<'a>Four-role mono font scale (display / heading / body / caption).
is_dark: boolWhether this is a dark theme.
is_high_contrast: boolWhether this is a high-contrast theme.
Implementations§
Source§impl<'a, C: PixelColor> Theme<'a, C>
impl<'a, C: PixelColor> Theme<'a, C>
Sourcepub fn default_font(&self) -> &'a MonoFont<'a>
pub fn default_font(&self) -> &'a MonoFont<'a>
Body font shortcut — what most widgets default to.
Trait Implementations§
Source§impl<'a, C: PixelColor> ButtonCatalog<C> for Theme<'a, C>
impl<'a, C: PixelColor> ButtonCatalog<C> for Theme<'a, C>
(class, status) to the colors the widget should paint.