pub enum Fidelity {
Ansi16,
Ansi256,
TrueColor,
}Expand description
How many colours the terminal can actually show.
Only Fidelity::Ansi16 changes what this crate draws. Above it, colour
separates a raised surface from a well on every shipped theme, and the
glyph fallback below never fires. Recorded rather than inferred, because a
caller that quantised its palette knows the answer and this crate cannot
recover it from the colours afterwards.
Variants§
Ansi16
Sixteen colours. Depth cannot be carried by colour: a well collapses onto its face on 18 of 31 themes and a bevel loses an edge on all 31.
Ansi256
The 6x6x6 cube and the grey ramp. Enough on 27 of 31 themes.
TrueColor
24-bit. The only failures left belong to the theme, not the terminal.
Implementations§
Source§impl Fidelity
impl Fidelity
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Read the terminal’s own claim, from COLORTERM then TERM.
Deliberately credulous. A terminal that understates itself costs a slightly heavier frame; one that overstates itself was going to render wrongly regardless of what this crate assumed.
Sourcepub const fn separates_depth(self) -> bool
pub const fn separates_depth(self) -> bool
Whether colour alone can tell a raised surface from a well here.
Trait Implementations§
impl Copy for Fidelity
impl Eq for Fidelity
impl StructuralPartialEq for Fidelity
Auto Trait Implementations§
impl Freeze for Fidelity
impl RefUnwindSafe for Fidelity
impl Send for Fidelity
impl Sync for Fidelity
impl Unpin for Fidelity
impl UnsafeUnpin for Fidelity
impl UnwindSafe for Fidelity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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