pub struct Theme {Show 131 fields
pub name: String,
pub editor_bg: Color,
pub editor_fg: Color,
pub cursor: Color,
pub inactive_cursor: Color,
pub selection_bg: Color,
pub selection_modifier: Modifier,
pub current_line_bg: Color,
pub line_number_fg: Color,
pub line_number_bg: Color,
pub after_eof_bg: Color,
pub ruler_bg: Color,
pub whitespace_indicator_fg: Color,
pub bracket_match_fg: Color,
pub bracket_rainbow_1: Color,
pub bracket_rainbow_2: Color,
pub bracket_rainbow_3: Color,
pub bracket_rainbow_4: Color,
pub bracket_rainbow_5: Color,
pub bracket_rainbow_6: Color,
pub diff_add_bg: Color,
pub diff_remove_bg: Color,
pub diff_modify_bg: Color,
pub diff_add_highlight_bg: Color,
pub diff_remove_highlight_bg: Color,
pub diff_add_collision_fg: Option<Color>,
pub diff_remove_collision_fg: Option<Color>,
pub diff_modify_collision_fg: Option<Color>,
pub tab_active_fg: Color,
pub tab_active_bg: Color,
pub tab_inactive_fg: Color,
pub tab_inactive_bg: Color,
pub tab_separator_bg: Color,
pub tab_close_hover_fg: Color,
pub tab_hover_bg: Color,
pub menu_bg: Color,
pub menu_fg: Color,
pub menu_active_bg: Color,
pub menu_active_fg: Color,
pub menu_dropdown_bg: Color,
pub menu_dropdown_fg: Color,
pub menu_highlight_bg: Color,
pub menu_highlight_fg: Color,
pub menu_border_fg: Color,
pub menu_separator_fg: Color,
pub menu_hover_bg: Color,
pub menu_hover_fg: Color,
pub menu_disabled_fg: Color,
pub menu_disabled_bg: Color,
pub status_bar_fg: Color,
pub status_bar_bg: Color,
pub status_palette_fg: Color,
pub status_palette_bg: Color,
pub status_separator_fg: Color,
pub status_separator_bg: Color,
pub status_lsp_on_fg: Color,
pub status_lsp_on_bg: Color,
pub status_lsp_actionable_fg: Color,
pub status_lsp_actionable_bg: Color,
pub prompt_fg: Color,
pub prompt_bg: Color,
pub prompt_selection_fg: Color,
pub prompt_selection_bg: Color,
pub popup_border_fg: Color,
pub popup_bg: Color,
pub popup_selection_bg: Color,
pub popup_selection_fg: Color,
pub popup_text_fg: Color,
pub text_input_selection_bg: Color,
pub suggestion_bg: Color,
pub suggestion_fg: Color,
pub suggestion_selected_bg: Color,
pub help_bg: Color,
pub help_fg: Color,
pub help_key_fg: Color,
pub help_separator_fg: Color,
pub help_indicator_fg: Color,
pub help_indicator_bg: Color,
pub inline_code_bg: Color,
pub split_separator_fg: Color,
pub split_separator_hover_fg: Color,
pub scrollbar_track_fg: Color,
pub scrollbar_thumb_fg: Color,
pub scrollbar_track_hover_fg: Color,
pub scrollbar_thumb_hover_fg: Color,
pub compose_margin_bg: Color,
pub semantic_highlight_bg: Color,
pub semantic_highlight_modifier: Modifier,
pub terminal_bg: Color,
pub terminal_fg: Color,
pub status_warning_indicator_bg: Color,
pub status_warning_indicator_fg: Color,
pub status_error_indicator_bg: Color,
pub status_error_indicator_fg: Color,
pub status_warning_indicator_hover_bg: Color,
pub status_warning_indicator_hover_fg: Color,
pub status_error_indicator_hover_bg: Color,
pub status_error_indicator_hover_fg: Color,
pub tab_drop_zone_bg: Color,
pub tab_drop_zone_border: Color,
pub settings_selected_bg: Color,
pub settings_selected_fg: Color,
pub file_status_added_fg: Color,
pub file_status_modified_fg: Color,
pub file_status_deleted_fg: Color,
pub file_status_renamed_fg: Color,
pub file_status_untracked_fg: Color,
pub file_status_conflicted_fg: Color,
pub search_match_bg: Color,
pub search_match_fg: Color,
pub search_label_bg: Color,
pub search_label_fg: Color,
pub diagnostic_error_fg: Color,
pub diagnostic_error_bg: Color,
pub diagnostic_warning_fg: Color,
pub diagnostic_warning_bg: Color,
pub diagnostic_info_fg: Color,
pub diagnostic_info_bg: Color,
pub diagnostic_hint_fg: Color,
pub diagnostic_hint_bg: Color,
pub syntax_keyword: Color,
pub syntax_string: Color,
pub syntax_comment: Color,
pub syntax_function: Color,
pub syntax_type: Color,
pub syntax_variable: Color,
pub syntax_variable_builtin: Color,
pub syntax_constant: Color,
pub syntax_operator: Color,
pub syntax_punctuation_bracket: Color,
pub syntax_punctuation_delimiter: Color,
}Expand description
Comprehensive theme structure with all UI colors
Fields§
§name: StringTheme name (e.g., “dark”, “light”, “high-contrast”)
editor_bg: Color§editor_fg: Color§cursor: Color§inactive_cursor: Color§selection_bg: Color§selection_modifier: ModifierSGR text attributes layered onto selected cells. Empty for
traditional themes; native-palette themes set
Modifier::REVERSED so the selection inverts the terminal’s
current fg/bg (vim/neovim Visual, helix term16, htop, less).
current_line_bg: Color§line_number_fg: Color§line_number_bg: Color§after_eof_bg: ColorBackground color for rows past end-of-file
ruler_bg: Color§whitespace_indicator_fg: Color§bracket_match_fg: Color§bracket_rainbow_1: Color§bracket_rainbow_2: Color§bracket_rainbow_3: Color§bracket_rainbow_4: Color§bracket_rainbow_5: Color§bracket_rainbow_6: Color§diff_add_bg: Color§diff_remove_bg: Color§diff_modify_bg: Color§diff_add_highlight_bg: ColorBrighter background for inline diff highlighting on added content
diff_remove_highlight_bg: ColorBrighter background for inline diff highlighting on removed content
diff_add_collision_fg: Option<Color>Collision-only fg fallback for cells whose existing fg matches
diff_*_bg. None keeps the cell’s original fg; overlays opt
into the override via fg_on_collision_only.
diff_remove_collision_fg: Option<Color>§diff_modify_collision_fg: Option<Color>§tab_active_fg: Color§tab_active_bg: Color§tab_inactive_fg: Color§tab_inactive_bg: Color§tab_separator_bg: Color§tab_close_hover_fg: Color§tab_hover_bg: Color§status_bar_fg: Color§status_bar_bg: Color§status_palette_fg: ColorStatus bar palette shortcut hint colors (default: same as status bar)
status_palette_bg: Color§status_separator_fg: ColorStatus bar separator glyph colors (default: same as status bar)
status_separator_bg: Color§status_lsp_on_fg: ColorStatus bar LSP indicator colors when running (default: same as status bar)
status_lsp_on_bg: Color§status_lsp_actionable_fg: ColorStatus bar LSP indicator colors when actionable options are available (configured-but-not-running). Default: same as status warning indicator.
status_lsp_actionable_bg: Color§prompt_fg: Color§prompt_bg: Color§prompt_selection_fg: Color§prompt_selection_bg: Color§popup_border_fg: Color§popup_bg: Color§popup_selection_bg: Color§popup_selection_fg: Color§popup_text_fg: Color§text_input_selection_bg: ColorBackground for the selection span inside a widget Text
input. See the file-format field doc for why this isn’t
just editor.selection_bg.
suggestion_bg: Color§suggestion_fg: Color§suggestion_selected_bg: Color§help_bg: Color§help_fg: Color§help_key_fg: Color§help_separator_fg: Color§help_indicator_fg: Color§help_indicator_bg: Color§inline_code_bg: ColorBackground color for inline code in help popups
split_separator_fg: Color§split_separator_hover_fg: Color§scrollbar_track_fg: Color§scrollbar_thumb_fg: Color§scrollbar_track_hover_fg: Color§scrollbar_thumb_hover_fg: Color§compose_margin_bg: Color§semantic_highlight_bg: Color§semantic_highlight_modifier: ModifierSGR text attributes layered onto current-word-highlight cells.
Native-palette themes typically set Modifier::BOLD (so the
word stands out without altering its color slot) or
Modifier::REVERSED.
terminal_bg: Color§terminal_fg: Color§status_warning_indicator_bg: Color§status_warning_indicator_fg: Color§status_error_indicator_bg: Color§status_error_indicator_fg: Color§status_warning_indicator_hover_bg: Color§status_warning_indicator_hover_fg: Color§status_error_indicator_hover_bg: Color§status_error_indicator_hover_fg: Color§tab_drop_zone_bg: Color§tab_drop_zone_border: Color§settings_selected_bg: Color§settings_selected_fg: Color§file_status_added_fg: Color§file_status_modified_fg: Color§file_status_deleted_fg: Color§file_status_renamed_fg: Color§file_status_untracked_fg: Color§file_status_conflicted_fg: Color§search_match_bg: Color§search_match_fg: Color§search_label_bg: Color§search_label_fg: Color§diagnostic_error_fg: Color§diagnostic_error_bg: Color§diagnostic_warning_fg: Color§diagnostic_warning_bg: Color§diagnostic_info_fg: Color§diagnostic_info_bg: Color§diagnostic_hint_fg: Color§diagnostic_hint_bg: Color§syntax_keyword: Color§syntax_string: Color§syntax_comment: Color§syntax_function: Color§syntax_type: Color§syntax_variable: Color§syntax_variable_builtin: Color§syntax_constant: Color§syntax_operator: Color§syntax_punctuation_bracket: Color§syntax_punctuation_delimiter: ColorImplementations§
Source§impl Theme
impl Theme
Sourcepub fn set_terminal_cursor_color(&self)
pub fn set_terminal_cursor_color(&self)
Set the terminal cursor color using OSC 12 escape sequence. This makes the hardware cursor visible on any background.
Sourcepub fn reset_terminal_cursor_color()
pub fn reset_terminal_cursor_color()
Reset the terminal cursor color to default.
Source§impl Theme
impl Theme
Sourcepub fn is_light(&self) -> bool
pub fn is_light(&self) -> bool
Returns true when the theme has a light background.
Uses the relative luminance of editor_bg (perceived brightness).
A threshold of 0.5 separates dark from light; for Color::Reset or
unresolvable colors, falls back to false (dark).
Sourcepub fn load_builtin(name: &str) -> Option<Self>
pub fn load_builtin(name: &str) -> Option<Self>
Load a builtin theme by name (no I/O, uses embedded JSON).
Sourcepub fn from_json(json: &str) -> Result<Self, String>
pub fn from_json(json: &str) -> Result<Self, String>
Parse theme from JSON string (no I/O).
Supports the inheritance model documented on ThemeFile: an explicit
extends chooses the base; otherwise the relative luminance of an
explicit editor.bg picks builtin://light vs builtin://dark;
otherwise the per-field hardcoded defaults apply. Every leaf the user
JSON specifies overrides the corresponding field on the base — the
override walk uses the same resolve_theme_key_mut machinery as
override_colors, so the supported set of keys stays in lock-step.
Sourcepub fn modifier_for_bg_key(&self, key: &str) -> Modifier
pub fn modifier_for_bg_key(&self, key: &str) -> Modifier
SGR text-attribute modifier associated with a bg theme key.
Lets overlay-driven highlights (e.g. word-under-cursor via
ui.semantic_highlight_bg, selection via editor.selection_bg)
pick up the same modifier the theme would apply directly when
painting that region, so a terminal theme’s ["reversed"]
selection works whether the cells go through char_style or
the overlay pipeline. Unknown keys return Modifier::empty().
Sourcepub fn resolve_theme_key(&self, key: &str) -> Option<Color>
pub fn resolve_theme_key(&self, key: &str) -> Option<Color>
Resolve a theme key to a Color.
Theme keys use dot notation: “section.field” Examples:
- “ui.status_bar_fg” -> status_bar_fg
- “editor.selection_bg” -> selection_bg
- “syntax.keyword” -> syntax_keyword
- “diagnostic.error_fg” -> diagnostic_error_fg
Returns None if the key is not recognized.
Sourcepub fn resolve_theme_key_mut(&mut self, key: &str) -> Option<&mut Color>
pub fn resolve_theme_key_mut(&mut self, key: &str) -> Option<&mut Color>
Mutable companion to [resolve_theme_key]. Keep the two matches in
lock-step: any key readable by resolve_theme_key should also be
writable here, and vice versa.
Sourcepub fn override_colors<I, K>(&mut self, overrides: I) -> usize
pub fn override_colors<I, K>(&mut self, overrides: I) -> usize
Apply a map of "section.field" -> Color overrides to the running
theme in-place. Returns the number of keys that matched a known
theme field. Unknown keys are silently dropped so a typo in a fast
animation loop doesn’t crash the caller.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more