Raxol.Themes (Raxol v2.0.1)
View SourceTheme management system for Raxol terminal.
This module handles theme loading, application, and management for the terminal emulator. It supports dynamic theme switching and plugin-based theme customization.
Summary
Functions
Applies a theme to the terminal.
Returns a specification to start this module under a supervisor.
Gets the currently active theme.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Lists all available themes.
Loads a theme from a file or predefined theme name.
Registers a theme change callback.
Functions
Applies a theme to the terminal.
Parameters
theme: A theme map with the following structure:%{ background: color, foreground: color, cursor: color, selection: color }
Colors can be:
- Atoms:
:default,:black,:red, etc. - RGB tuples:
{255, 0, 0} - RGBA tuples:
{255, 0, 0, 128}
Returns
:okon success{:error, reason}on failure
Returns a specification to start this module under a supervisor.
See Supervisor.
Gets the currently active theme.
Returns
The current theme map or nil if no theme is active.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Lists all available themes.
Returns
A list of theme names that can be loaded.
Loads a theme from a file or predefined theme name.
Parameters
theme_identifier: Either a file path or a predefined theme name
Returns
{:ok, theme}on success{:error, reason}on failure
Registers a theme change callback.
Parameters
callback_module: Module that implementson_theme_change/1callback_fun: Function name to call (default::on_theme_change)
Returns
:okon success