Skip to main content

get_syntax_theme_for_ui_theme

Function get_syntax_theme_for_ui_theme 

Source
pub fn get_syntax_theme_for_ui_theme(ui_theme: &str) -> &'static str
Expand description

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

§Usage

For code blocks and syntax highlighting:

use vtcode_tui::ui::theme::{get_syntax_theme_for_ui_theme, active_theme_id};
let ui_theme = active_theme_id();
let syntax_theme = get_syntax_theme_for_ui_theme(&ui_theme);
// Use `syntax_theme` with syntect's ThemeSet

For PTY/shell output highlighting, the same mapping applies. The shell command highlighter should use the same color palette as the syntax highlighting theme for visual consistency.