pub struct Theme {
pub window_bg: Color,
pub titlebar_bg: Color,
pub button_bg: Color,
pub button_bg_hover: Color,
pub button_bg_pressed: Color,
pub close_bg_hover: Color,
pub close_bg_pressed: Color,
pub titlebar_control_hover: Color,
pub titlebar_control_pressed: Color,
pub icon_fg: Color,
}Expand description
Semantic color tokens for built-in chrome and controls.
§Examples
use ailloli_ui_core::style::Theme;
let theme = Theme::dark();
assert_ne!(theme.button_bg, theme.window_bg);Fields§
§window_bg: ColorClient window background.
titlebar_bg: ColorTitle bar background (client chrome).
Normal action-button fill.
Action-button fill while hovered.
Action-button fill while pressed.
close_bg_hover: ColorDestructive close-control fill while hovered.
close_bg_pressed: ColorDestructive close-control fill while pressed.
titlebar_control_hover: ColorHover fill for minimize/maximize title-bar controls.
titlebar_control_pressed: ColorPressed fill for minimize/maximize title-bar controls.
icon_fg: ColorDefault icon foreground on chrome.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn dark() -> Self
pub fn dark() -> Self
Returns the built-in dark theme with orange action accents.
§Examples
use ailloli_ui_core::style::Theme;
assert_eq!(Theme::dark().button_bg.as_rgba8(), (255, 90, 0, 255));Sourcepub fn palette(self) -> ThemePalette
pub fn palette(self) -> ThemePalette
Returns the built-in semantic color palette.
The current palette is a fixed bundle and is not recomputed from
mutable public chrome fields on Theme.
§Examples
use ailloli_ui_core::style::Theme;
assert_eq!(Theme::dark().palette().accent.as_rgba8(), (255, 90, 0, 255));Sourcepub const fn radius(self) -> ThemeRadius
pub const fn radius(self) -> ThemeRadius
Returns the fixed 4/8/12/16 logical-pixel radius scale.
§Examples
use ailloli_ui_core::style::Theme;
assert_eq!((Theme::dark().radius().sm, Theme::dark().radius().xl), (4.0, 16.0));Sourcepub const fn spacing(self) -> ThemeSpacing
pub const fn spacing(self) -> ThemeSpacing
Returns the fixed 4/8/12/16/24 logical-pixel spacing scale.
§Examples
use ailloli_ui_core::style::Theme;
assert_eq!(Theme::dark().spacing().md, 12.0);Sourcepub fn typography(self) -> ThemeTypography
pub fn typography(self) -> ThemeTypography
Builds standard text styles using the built-in palette text color.
Sizes are 12, 14, and 18 logical pixels for UI text and 14 for monospace text.
§Examples
use ailloli_ui_core::FontId;
use ailloli_ui_core::style::Theme;
assert_eq!(Theme::dark().typography().mono_md.font, FontId::Mono);