pub struct ColorCode(/* private fields */);
Expand description
Packed VGA attribute byte for text mode: bits 0–3 = foreground color; 4–6 = background color; 7 = blink/bright (mode-dependent).
Implementations§
Source§impl ColorCode
impl ColorCode
Sourcepub const fn new(fg: Color, bg: Color, blink: bool) -> Self
pub const fn new(fg: Color, bg: Color, blink: bool) -> Self
Build a color code from fg/bg/blink. Note: with Attribute Controller mode bit 7 = blink enabled, bit 7 here blinks. If blink is disabled in the controller, bit 7 acts as “bright background”.
Sourcepub const fn bg(self) -> Color
pub const fn bg(self) -> Color
Note: background uses only 3 bits (0..=7). Bright backgrounds require disabling blink in the Attribute Controller and repurposing bit 7.
pub const fn blink(self) -> bool
Trait Implementations§
impl Copy for ColorCode
impl Eq for ColorCode
impl StructuralPartialEq for ColorCode
Auto Trait Implementations§
impl Freeze for ColorCode
impl RefUnwindSafe for ColorCode
impl Send for ColorCode
impl Sync for ColorCode
impl Unpin for ColorCode
impl UnwindSafe for ColorCode
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