pub struct RabTheme {
pub name: String,
/* private fields */
}Expand description
The concrete theme used by the rab UI. Wraps resolved ANSI escape codes for foregrounds, backgrounds, and text styling.
Fields§
§name: StringImplementations§
Source§impl RabTheme
impl RabTheme
Sourcepub fn from_config(config: &ThemeConfig, mode: ColorMode) -> Self
pub fn from_config(config: &ThemeConfig, mode: ColorMode) -> Self
Build a RabTheme from a ThemeConfig.
Sourcepub fn fg_ansi(&self, color: &str) -> &str
pub fn fg_ansi(&self, color: &str) -> &str
Get the ANSI foreground escape code for a color name.
Sourcepub fn bg_ansi(&self, color: &str) -> &str
pub fn bg_ansi(&self, color: &str) -> &str
Get the ANSI background escape code for a color name.
Sourcepub fn inverse(&self, text: &str) -> String
pub fn inverse(&self, text: &str) -> String
Apply reverse/inverse video styling (used for intra-line diff highlighting).
Sourcepub fn strikethrough(&self, text: &str) -> String
pub fn strikethrough(&self, text: &str) -> String
Apply strikethrough styling.
Sourcepub fn color_mode(&self) -> ColorMode
pub fn color_mode(&self) -> ColorMode
Get the color mode.
Sourcepub fn text_color(&self, text: &str) -> String
pub fn text_color(&self, text: &str) -> String
Apply text foreground color.
Sourcepub fn user_msg_bg(&self, text: &str) -> String
pub fn user_msg_bg(&self, text: &str) -> String
Apply user message background.
Sourcepub fn thinking_bg(&self, text: &str) -> String
pub fn thinking_bg(&self, text: &str) -> String
Apply thinking block background.
Sourcepub fn bold_accent(&self, text: &str) -> String
pub fn bold_accent(&self, text: &str) -> String
Bold + accent foreground.
Source§impl RabTheme
impl RabTheme
Sourcepub fn fg_ansi_key(&self, key: ThemeKey) -> &str
pub fn fg_ansi_key(&self, key: ThemeKey) -> &str
Get ANSI foreground escape code for a ThemeKey.
Sourcepub fn bg_ansi_key(&self, key: ThemeKey) -> &str
pub fn bg_ansi_key(&self, key: ThemeKey) -> &str
Get ANSI background escape code for a ThemeKey.
Sourcepub fn fg_key(&self, key: ThemeKey, text: &str) -> String
pub fn fg_key(&self, key: ThemeKey, text: &str) -> String
Apply foreground color from a ThemeKey.
Sourcepub fn bg_key(&self, key: ThemeKey, text: &str) -> String
pub fn bg_key(&self, key: ThemeKey, text: &str) -> String
Apply background color from a ThemeKey.
Sourcepub fn fg_style_key(&self, key: ThemeKey) -> Style
pub fn fg_style_key(&self, key: ThemeKey) -> Style
Create a Style with foreground from a ThemeKey.
Sourcepub fn bg_style_key(&self, key: ThemeKey) -> Style
pub fn bg_style_key(&self, key: ThemeKey) -> Style
Create a Style with background from a ThemeKey.
Trait Implementations§
Source§impl Theme for RabTheme
impl Theme for RabTheme
Source§fn fg(&self, color: &str, text: &str) -> String
fn fg(&self, color: &str, text: &str) -> String
color is a color name (e.g., “accent”, “text”, “success”, “error”, “muted”).Source§fn italic(&self, text: &str) -> String
fn italic(&self, text: &str) -> String
Source§fn inverse(&self, text: &str) -> String
fn inverse(&self, text: &str) -> String
Source§fn fg_ansi(&self, color: &str) -> &str
fn fg_ansi(&self, color: &str) -> &str
Source§fn fg_ansi_key(&self, key: ThemeKey) -> &str
fn fg_ansi_key(&self, key: ThemeKey) -> &str
ThemeKey color (without text).