Module theme

Module theme 

Source
Expand description

UI theme methods.

Provides various methods for changing and querying the current UI theme used to render text and UI widgets.

§Example

fn on_update(&mut self, s: &mut PixState) -> PixResult<()> {
    s.fill(Color::CADET_BLUE); // Change text color
    s.font_size(14)?;
    s.font_style(FontStyle::BOLD);
    s.font_family(Font::INCONSOLATA)?;
    s.text("Blue, bold, size 14 text in Inconsolata font")?;
    Ok(())
}

Structs§

Colors
A set of Colors for theming UI elements.
Font
Represents a font family name along with the font glyph source.
FontStyles
A set of FontStyles for body, heading, and monospace text.
Fonts
A set of font families for body, heading, and monospace text.
Spacing
A set of styles for sizing, padding, borders, etc for theming UI elements.
SpacingBuilder
Builds a Spacing instance by customizing various space and padding settings.
Theme
A UI Theme containing font families, sizes, styles, and colors.
ThemeBuilder
A builder to generate custom Themes.

Enums§

ColorType
Represents a given color-themed section in a UI.
FontType
Represents a given font-themed section in a UI.