Skip to main content

Module theme

Module theme 

Source

Structs§

ColorAccessibilityConfig
Color accessibility configuration loaded from vtcode.toml
ThemeDefinition
ThemePalette
Palette describing UI colors for the terminal experience.
ThemeStyles
Styles computed from palette colors.
ThemeSuite
Logical grouping of built-in themes.
ThemeValidationResult
Theme validation result

Constants§

DEFAULT_THEME_ID
Identifier for the default theme.

Functions§

active_styles
Get the current styles cloned from the active theme.
active_theme_id
Get the identifier of the active theme.
active_theme_label
Get the human-readable label of the active theme.
available_theme_suites
Enumerate built-in theme suites and their member theme ids.
available_themes
Enumerate available theme identifiers.
banner_color
Slightly adjusted accent color for banner-like copy.
banner_style
Slightly darkened accent style for banner-like copy.
ensure_theme
Validate a theme and return its label for messaging.
get_active_syntax_theme
Get the recommended syntax highlighting theme for the currently active UI theme. Convenience wrapper around get_syntax_theme_for_ui_theme.
get_minimum_contrast
Get the current minimum contrast ratio setting.
get_syntax_theme_for_ui_theme
Get the recommended syntax highlighting theme for a given UI theme. This ensures that code highlighting colors complement the UI theme’s background. Based on: https://github.com/openai/codex/pull/11447, https://github.com/openai/codex/pull/12581
is_bold_bright_mode
Check if bold-is-bright compatibility mode is enabled.
is_light_theme
Determine if a theme is a light theme based on its background luminance.
is_safe_colors_only
Check if safe colors only mode is enabled.
logo_accent_color
Accent color for the startup banner logo.
rebuild_active_styles
Rebuild the active theme’s styles with current accessibility settings. Call this after updating color accessibility configuration.
resolve_theme
Resolve a theme identifier from configuration or CLI input.
set_active_theme
Set the active theme by identifier.
set_color_accessibility_config
Update the global color accessibility configuration. Call this after loading vtcode.toml to apply user preferences.
suggest_theme_for_terminal
Get a suggested theme based on terminal color scheme detection. Returns a light or dark theme depending on detected terminal background.
theme_label
Look up a theme label for display.
theme_matches_terminal_scheme
Check if a theme is suitable for the detected terminal color scheme. Returns true if the theme matches (light theme for light terminal, dark for dark).
theme_suite_id
Resolve the suite identifier for a theme id.
theme_suite_label
Resolve the suite label for a theme id.
validate_theme_contrast
Validate a theme’s color contrast ratios. Returns warnings for colors that don’t meet WCAG AA standards.