pub struct WidgetColors {
pub fg: Option<Color>,
pub bg: Option<Color>,
pub border: Option<Color>,
pub accent: Option<Color>,
pub theme_fg: Option<ThemeColor>,
pub theme_bg: Option<ThemeColor>,
pub theme_border: Option<ThemeColor>,
pub theme_accent: Option<ThemeColor>,
}Expand description
Per-widget color overrides that fall back to the active theme.
Literal Color fields and ThemeColor fields can be set independently.
Resolution order: theme_* field > literal field > theme default.
Fields§
§fg: Option<Color>Foreground color override.
bg: Option<Color>Background color override.
border: Option<Color>Border color override.
accent: Option<Color>Accent color override.
theme_fg: Option<ThemeColor>Theme-aware foreground (takes precedence over Self::fg).
theme_bg: Option<ThemeColor>Theme-aware background (takes precedence over Self::bg).
theme_border: Option<ThemeColor>Theme-aware border (takes precedence over Self::border).
theme_accent: Option<ThemeColor>Theme-aware accent (takes precedence over Self::accent).
Implementations§
Source§impl WidgetColors
impl WidgetColors
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new WidgetColors with all fields set to None (theme defaults).
Sourcepub const fn theme_fg(self, color: ThemeColor) -> Self
pub const fn theme_fg(self, color: ThemeColor) -> Self
Set a theme-aware foreground color.
Sourcepub const fn theme_bg(self, color: ThemeColor) -> Self
pub const fn theme_bg(self, color: ThemeColor) -> Self
Set a theme-aware background color.
Sourcepub const fn theme_border(self, color: ThemeColor) -> Self
pub const fn theme_border(self, color: ThemeColor) -> Self
Set a theme-aware border color.
Sourcepub const fn theme_accent(self, color: ThemeColor) -> Self
pub const fn theme_accent(self, color: ThemeColor) -> Self
Set a theme-aware accent color.
Sourcepub fn resolve_fg(&self, theme: &Theme, fallback: Color) -> Color
pub fn resolve_fg(&self, theme: &Theme, fallback: Color) -> Color
Resolve the foreground color, preferring theme color, then literal, then fallback.
Sourcepub fn resolve_bg(&self, theme: &Theme, fallback: Color) -> Color
pub fn resolve_bg(&self, theme: &Theme, fallback: Color) -> Color
Resolve the background color, preferring theme color, then literal, then fallback.
Sourcepub fn resolve_border(&self, theme: &Theme, fallback: Color) -> Color
pub fn resolve_border(&self, theme: &Theme, fallback: Color) -> Color
Resolve the border color, preferring theme color, then literal, then fallback.
Sourcepub fn resolve_accent(&self, theme: &Theme, fallback: Color) -> Color
pub fn resolve_accent(&self, theme: &Theme, fallback: Color) -> Color
Resolve the accent color, preferring theme color, then literal, then fallback.
Trait Implementations§
Source§impl Clone for WidgetColors
impl Clone for WidgetColors
Source§fn clone(&self) -> WidgetColors
fn clone(&self) -> WidgetColors
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more