Raxol.Core.Accessibility.Preferences (Raxol v0.3.0)
View SourceManages accessibility preferences and settings.
Summary
Functions
Get the default preferences name.
Get an accessibility option value.
Get the current text scale factor based on the large text setting.
Enable or disable high contrast mode.
Enable or disable large text mode.
Set an accessibility option value.
Enable or disable reduced motion.
Functions
Get the default preferences name.
Examples
iex> Preferences.default_prefs_name()
Raxol.Core.UserPreferences
Get an accessibility option value.
Parameters
option_name
- The atom representing the accessibility option (e.g.,:high_contrast
).user_preferences_pid_or_name
- The PID or registered name of the UserPreferences process to use (optional).default
- The default value to return if the option is not set (optional).
Examples
iex> Preferences.get_option(:high_contrast)
false
Get the current text scale factor based on the large text setting.
Parameters
user_preferences_pid_or_name
- The PID or registered name of the UserPreferences process to use (optional).
Examples
iex> Preferences.get_text_scale()
1.0 # or 1.5 if large_text is enabled
Enable or disable high contrast mode.
Parameters
enabled
-true
to enable high contrast,false
to disable.user_preferences_pid_or_name
- The PID or registered name of the UserPreferences process to use (optional).
Examples
iex> Preferences.set_high_contrast(true)
:ok
Enable or disable large text mode.
Parameters
enabled
-true
to enable large text,false
to disable.user_preferences_pid_or_name
- The PID or registered name of the UserPreferences process to use (optional).
Examples
iex> Preferences.set_large_text(true)
:ok
Set an accessibility option value.
Parameters
key
- The option key to setvalue
- The value to setuser_preferences_pid_or_name
- The PID or registered name of the UserPreferences process to use (optional).
Examples
iex> Preferences.set_option(:high_contrast, true)
:ok
Enable or disable reduced motion.
Parameters
enabled
-true
to enable reduced motion,false
to disable.user_preferences_pid_or_name
- The PID or registered name of the UserPreferences process to use (optional).
Examples
iex> Preferences.set_reduced_motion(true)
:ok