Raxol.UI.Theming.Theme (Raxol v0.2.0)
View SourceDefines and manages UI themes for the Raxol system.
This module provides:
- Theme definition and registration
- Default theme settings
- Theme application to UI elements
- Color scheme management
Summary
Functions
Applies a theme to an element tree.
Gets a color from a theme.
Gets a component style from a theme.
Gets the dark theme.
Gets the default theme.
Gets a theme by ID.
Gets a color value considering the theme and an optional variant.
Initializes the theme system.
Lists all registered themes.
Registers a theme for use in the application.
Types
Functions
Applies a theme to an element tree.
Parameters
element
- The element tree to apply the theme totheme
- The theme to apply
Returns
The element tree with theme applied
Gets a color from a theme.
Parameters
theme
- The theme to get colors fromcolor_name
- The name of the color to get
Returns
The color value, or a default color if not found
Gets a component style from a theme.
Parameters
theme
- The theme to get styles fromcomponent_type
- The type of component to get styles for
Returns
A map of style properties for the component, or an empty map if not found
Gets the dark theme.
Returns
The dark theme struct
Gets the default theme.
Returns
The default theme struct
Gets a theme by ID.
Parameters
theme_id
- The ID of the theme to retrieve
Returns
The theme struct or nil if not found
Gets a color value considering the theme and an optional variant.
Looks up the color in the variant's palette first, then falls back to the theme's base palette.
Initializes the theme system.
Lists all registered themes.
Returns
A list of theme structs
Registers a theme for use in the application.
Parameters
theme
- The theme struct to register
Returns
:ok