pub struct Style {
pub fg: Option<Color>,
pub bg: Option<Color>,
pub modifiers: Modifiers,
}Expand description
Visual style for a terminal cell (foreground, background, modifiers).
Styles are applied to text via the builder methods on Context widget
calls (e.g., .bold(), .fg(Color::Cyan)). All fields are optional;
None means “inherit from the terminal default.”
§Example
use slt::{Style, Color};
let style = Style::new().fg(Color::Cyan).bold();Fields§
§fg: Option<Color>Foreground color, or None to use the terminal default.
bg: Option<Color>Background color, or None to use the terminal default.
modifiers: ModifiersText modifiers (bold, italic, underline, etc.).
Implementations§
Source§impl Style
impl Style
Sourcepub fn strikethrough(self) -> Self
pub fn strikethrough(self) -> Self
Add the strikethrough modifier.
Trait Implementations§
impl Copy for Style
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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