pub struct Glyph {
pub ch: char,
pub fg: Color,
pub bg: Color,
}Expand description
A posterized pixel block: the best-matching glyph plus its foreground and background colors.
The background color is only meaningful for glyphs that don’t cover the full cell (anything
but ' ' and '█'); the foreground color is only meaningful for glyphs other than ' '.
Both are still populated for those edge cases (as the block’s overall average color) so a
caller never has to special-case Glyph before styling a cell with it.
Fields§
§ch: charThe selected block-element/quadrant/sextant character.
fg: ColorThe color assigned to the “on” pixels (those set in the glyph’s bit pattern).
bg: ColorThe color assigned to the “off” pixels (those clear in the glyph’s bit pattern).
Trait Implementations§
impl Copy for Glyph
impl Eq for Glyph
impl StructuralPartialEq for Glyph
Auto Trait Implementations§
impl Freeze for Glyph
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnsafeUnpin for Glyph
impl UnwindSafe for Glyph
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,
§impl<C> WithAlpha for Cwhere
C: Copy,
impl<C> WithAlpha for Cwhere
C: Copy,
§fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
Wraps
self with alpha, storing alpha before the color in memory
(see [AlphaFirst]).§fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
Wraps
self with alpha, storing alpha after the color in memory
(see [AlphaLast]).