Skip to main content

Module theme

Module theme 

Source
Expand description

Process-wide light/dark theme for Glassy UI.

use glassy_ui::{init_theme, ActiveTheme, Theme};

fn main() {
    application().run(|cx| {
        init_theme(cx);
        // later, anywhere you have App / Context:
        let theme = cx.theme();
        div().bg(theme.canvas).text_color(theme.ink);
        cx.toggle_theme();
    });
}

Structs§

Theme
Semantic colors for the active scheme.

Enums§

ThemeKind
Light or dark kit surface.

Constants§

FONT_FAMILY
Typeface used on the Paper kit pages.

Traits§

ActiveTheme
Read and switch the process-wide theme.

Functions§

init
Install the default light theme. Call once at app startup.
paint
0xRRGGBBAA.
rgb
Opaque 0xRRGGBB.