pub struct Theme {Show 99 fields
pub name: String,
pub editor_bg: Color,
pub editor_fg: Color,
pub cursor: Color,
pub inactive_cursor: Color,
pub selection_bg: Color,
pub current_line_bg: Color,
pub line_number_fg: Color,
pub line_number_bg: Color,
pub ruler_bg: Color,
pub whitespace_indicator_fg: 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 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 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 suggestion_bg: 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 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 search_match_bg: Color,
pub search_match_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_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§current_line_bg: Color§line_number_fg: Color§line_number_bg: Color§ruler_bg: Color§whitespace_indicator_fg: 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
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§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§suggestion_bg: 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§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§search_match_bg: Color§search_match_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_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 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.
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