Raxol.Style.Colors.System.ColorSystemServer (Raxol v2.0.1)

View Source

GenServer implementation for the color system in Raxol.

This server manages color themes, high contrast settings, and provides color resolution services while eliminating Process dictionary usage.

Features

  • Theme management and switching
  • High contrast mode support
  • Automatic accessibility adjustments
  • Color caching and resolution
  • Event-driven theme changes

Summary

Functions

Apply a theme to the color system.

Returns a child specification for this server.

Get accessibility options from the server.

Get all UI colors for the current theme.

Get a color from the current theme.

Get the current theme.

Get the current theme name.

Check if high contrast mode is enabled.

Get a UI color by role.

Handle accessibility preference changes.

Handle high contrast mode changes.

Initialize the color system with a theme and settings.

Register a custom theme.

Set accessibility options.

Set the current theme.

Functions

apply_theme(theme_name, opts \\ [])

Apply a theme to the color system.

child_spec(init_arg)

Returns a child specification for this server.

get_accessibility_options()

Get accessibility options from the server.

get_all_ui_colors()

Get all UI colors for the current theme.

get_color(color_name, variant \\ :base)

Get a color from the current theme.

get_current_theme()

Get the current theme.

get_current_theme_name()

Get the current theme name.

get_high_contrast()

Check if high contrast mode is enabled.

get_ui_color(ui_role)

Get a UI color by role.

handle_accessibility_preference_changed(event_type, event_data)

Handle accessibility preference changes.

handle_high_contrast(event_type, event_data)

Handle high contrast mode changes.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

init_system(opts \\ [])

Initialize the color system with a theme and settings.

register_theme(theme_attrs)

Register a custom theme.

set_accessibility_options(options)

Set accessibility options.

set_current_theme(theme_name)

Set the current theme.

start_link(init_opts \\ [])