pub struct Theme {Show 28 fields
pub name: String,
pub bg: ThemeColor,
pub bg_hard: ThemeColor,
pub bg_soft: ThemeColor,
pub bg_panel: ThemeColor,
pub selection_bg: ThemeColor,
pub fg: ThemeColor,
pub fg_bright: ThemeColor,
pub fg_secondary: ThemeColor,
pub gray: ThemeColor,
pub selection_fg: ThemeColor,
pub border_dim: ThemeColor,
pub focus_border: ThemeColor,
pub accent: ThemeColor,
pub cursor: ThemeColor,
pub red: ThemeColor,
pub green: ThemeColor,
pub yellow: ThemeColor,
pub blue: ThemeColor,
pub purple: ThemeColor,
pub aqua: ThemeColor,
pub orange: ThemeColor,
pub color_directory: ThemeColor,
pub color_journal_date: ThemeColor,
pub color_search_match: ThemeColor,
pub color_tag: ThemeColor,
pub blockquote_bar: ThemeColor,
pub code_bg: ThemeColor,
}Expand description
Theme for the TUI application.
Fields are named after the UI roles they fill, making it straightforward to
map any popular terminal color scheme (Gruvbox, Catppuccin, Tokyo Night, …)
to this struct. Custom themes can be placed as .toml files in the themes
config directory and will be loaded automatically at startup.
§Example theme file (~/.config/kimun/themes/mytheme.toml)
name = "My Theme"
bg = "#1e1e2e"
bg_hard = "#11111b"
bg_soft = "#313244"
bg_panel = "#181825"
selection_bg = "#313244"
fg = "#cdd6f4"
fg_bright = "#f5e0dc"
fg_secondary = "#a6adc8"
gray = "#6c7086"
selection_fg = "#cdd6f4"
border_dim = "#45475a"
focus_border = "#89b4fa"
accent = "#89b4fa"
cursor = "#f5e0dc"
red = "#f38ba8"
green = "#a6e3a1"
yellow = "#f9e2af"
blue = "#89b4fa"
purple = "#cba6f7"
aqua = "#94e2d5"
orange = "#fab387"
color_directory = "#89dceb"
color_journal_date = "#94e2d5"
color_search_match = "#a6e3a1"
color_tag = "#fab387"
blockquote_bar = "#cba6f7"
code_bg = "#181825"Roles introduced after a theme file was written may be omitted — they are
derived from the closest sibling role (see [ThemeToml]).
Fields§
§name: String§bg: ThemeColorMain/editor background.
bg_hard: ThemeColorHard-contrast background: modals and input fields.
bg_soft: ThemeColorSoft background: alternating rows, horizontal rules.
bg_panel: ThemeColorSidebar / panel background (usually slightly offset from bg).
selection_bg: ThemeColorBackground of the currently selected row in lists.
fg: ThemeColorPrimary text color.
fg_bright: ThemeColorBright/high-contrast text: titles, headings.
fg_secondary: ThemeColorSecondary text: filenames, metadata, subdued hints.
gray: ThemeColorVery dim text: placeholders, separators, disabled items.
selection_fg: ThemeColorText color of a selected/highlighted row (often brighter than fg).
border_dim: ThemeColorDefault (unfocused) border color.
focus_border: ThemeColorBorder color when the pane has keyboard focus.
accent: ThemeColorPrimary accent: title bars, active markers, cursor highlights.
cursor: ThemeColorBlock-cursor color in text fields.
red: ThemeColorErrors, destructive actions, query negation.
green: ThemeColorSuccess / OK states.
yellow: ThemeColorWarnings, field keys, keycaps.
blue: ThemeColorWikilink targets.
purple: ThemeColorNumbers and date literals.
aqua: ThemeColorTags, links, group labels.
orange: ThemeColorOperators and strong accents.
color_directory: ThemeColorColor used for directory entries in the file list.
color_journal_date: ThemeColorColor for the journal-date annotation line in journal entries.
color_search_match: ThemeColorColor for highlighted search-match text.
color_tag: ThemeColorColor for #hashtag label spans in the editor.
blockquote_bar: ThemeColorColor of the │ blockquote bar drawn in place of > markers.
code_bg: ThemeColorBackground of fenced and indented code blocks (the “code box”).
Inline code uses selection_bg, not this.
Implementations§
Source§impl Theme
impl Theme
pub fn gruvbox_dark() -> Self
pub fn gruvbox_light() -> Self
pub fn catppuccin_mocha() -> Self
pub fn catppuccin_latte() -> Self
pub fn tokyo_night() -> Self
pub fn tokyo_night_storm() -> Self
pub fn solarized_dark() -> Self
pub fn solarized_light() -> Self
pub fn nord() -> Self
pub fn dracula() -> Self
pub fn one_dark() -> Self
pub fn one_light() -> Self
pub fn monokai() -> Self
pub fn everforest_dark() -> Self
pub fn everforest_light() -> Self
pub fn rose_pine() -> Self
Sourcepub fn rose_pine_dawn() -> Self
pub fn rose_pine_dawn() -> Self
Dawn is Rosé Pine’s light variant. Note bg_panel (surface) is
lighter than bg (base) — that is the official palette layering.
pub fn kanagawa_wave() -> Self
Sourcepub fn kanagawa_lotus() -> Self
pub fn kanagawa_lotus() -> Self
Lotus is Kanagawa’s light variant.
Sourcepub fn ansi() -> Self
pub fn ansi() -> Self
Uses the terminal’s 16 ANSI colors so the theme adapts to whatever
palette the user has configured in their terminal emulator. Works for
both light and dark terminal palettes because backgrounds and primary
foregrounds use Reset (the terminal’s defaults) and accents are
chromatic ANSI slots whose hue is stable across palettes.
Source§impl Theme
impl Theme
Sourcepub fn adapt_to_terminal(self) -> Theme
pub fn adapt_to_terminal(self) -> Theme
Adapt this theme to the terminal the process is running in.
The one entry point display paths should use — AppSettings::get_theme()
and the settings-screen live preview both funnel through it.
Sourcepub fn adapt(self, depth: ColorDepth) -> Theme
pub fn adapt(self, depth: ColorDepth) -> Theme
Return a copy of this theme adapted to the given color depth.
Truecolor terminals get the theme unchanged.
Source§impl Theme
impl Theme
Sourcepub fn border_style(&self, focused: bool) -> Style
pub fn border_style(&self, focused: bool) -> Style
Returns the appropriate border style depending on focus state.
Sourcepub fn base_style(&self) -> Style
pub fn base_style(&self) -> Style
Base style for most surfaces: theme fg on theme bg.
Sourcepub fn panel_style(&self) -> Style
pub fn panel_style(&self) -> Style
Panel style for sidebars and panels: theme fg on bg_panel.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Theme
impl<'de> Deserialize<'de> for Theme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Theme
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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