pub struct ThemeStyle {
pub fg: Option<ThemeColor>,
pub bg: Option<ThemeColor>,
pub bold: bool,
pub italic: bool,
pub underline: bool,
pub dim: bool,
}Expand description
A composed style with foreground, background, and modifiers.
This represents a complete text style that can be applied to UI elements. Adapters convert this to framework-specific styles (Ratatui Style, etc.).
Fields§
§fg: Option<ThemeColor>Foreground (text) color.
bg: Option<ThemeColor>Background color.
bold: boolBold text modifier.
italic: boolItalic text modifier.
underline: boolUnderline text modifier.
dim: boolDim/faint text modifier.
Implementations§
Source§impl ThemeStyle
impl ThemeStyle
Sourcepub const fn fg(color: ThemeColor) -> Self
pub const fn fg(color: ThemeColor) -> Self
Create a style with only a foreground color.
Sourcepub const fn bg(color: ThemeColor) -> Self
pub const fn bg(color: ThemeColor) -> Self
Create a style with only a background color.
Sourcepub const fn with_fg(self, color: ThemeColor) -> Self
pub const fn with_fg(self, color: ThemeColor) -> Self
Set the foreground color.
Sourcepub const fn with_bg(self, color: ThemeColor) -> Self
pub const fn with_bg(self, color: ThemeColor) -> Self
Set the background color.
Trait Implementations§
Source§impl Clone for ThemeStyle
impl Clone for ThemeStyle
Source§fn clone(&self) -> ThemeStyle
fn clone(&self) -> ThemeStyle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ThemeStyle
impl Debug for ThemeStyle
Source§impl Default for ThemeStyle
impl Default for ThemeStyle
Source§fn default() -> ThemeStyle
fn default() -> ThemeStyle
Returns the “default value” for a type. Read more
Source§impl PartialEq for ThemeStyle
impl PartialEq for ThemeStyle
Source§impl ToRatatuiStyle for ThemeStyle
impl ToRatatuiStyle for ThemeStyle
Source§fn to_ratatui(&self) -> Style
fn to_ratatui(&self) -> Style
Convert to Ratatui Style.
impl StructuralPartialEq for ThemeStyle
Auto Trait Implementations§
impl Freeze for ThemeStyle
impl RefUnwindSafe for ThemeStyle
impl Send for ThemeStyle
impl Sync for ThemeStyle
impl Unpin for ThemeStyle
impl UnwindSafe for ThemeStyle
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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>
Converts
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>
Converts
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 more