Expand description
Attr
is a rendering attribute that contains fg color, bg color and text effect.
use tuikit::attr::{Attr, Effect, Color};
let attr = Attr { fg: Color::RED, effect: Effect::BOLD, ..Attr::default() };
Fields
fg: Color
bg: Color
effect: Effect
Implementations
sourceimpl Attr
impl Attr
sourcepub fn extend(&self, new_attr: Self) -> Attr
pub fn extend(&self, new_attr: Self) -> Attr
extend the properties with the new attr’s if the properties in new attr is not default.
use tuikit::attr::{Attr, Color, Effect};
let default = Attr{fg: Color::BLUE, bg: Color::YELLOW, effect: Effect::BOLD};
let new = Attr{fg: Color::Default, bg: Color::WHITE, effect: Effect::REVERSE};
let extended = default.extend(new);
assert_eq!(Color::BLUE, extended.fg);
assert_eq!(Color::WHITE, extended.bg);
assert_eq!(Effect::BOLD | Effect::REVERSE, extended.effect);
pub fn fg(self, fg: Color) -> Self
pub fn bg(self, bg: Color) -> Self
pub fn effect(self, effect: Effect) -> Self
Trait Implementations
impl Copy for Attr
impl StructuralPartialEq for Attr
Auto Trait Implementations
impl RefUnwindSafe for Attr
impl Send for Attr
impl Sync for Attr
impl Unpin for Attr
impl UnwindSafe for Attr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more