pub enum ColorLevel {
Auto,
Truecolor,
Ansi256,
Ansi16,
None,
}Expand description
Color capability tier supported by the terminal.
Variants§
Auto
Automatically detected from terminal capabilities and environment.
Truecolor
Full 24-bit Truecolor (16 million RGB colors).
Ansi256
8-bit ANSI 256-color palette.
Ansi16
4-bit standard ANSI 16-color palette.
None
No colors supported or color disabled.
Implementations§
Source§impl ColorLevel
impl ColorLevel
Sourcepub fn detect() -> ColorLevel
pub fn detect() -> ColorLevel
Detect the terminal’s color capability tier from environment variables.
Sourcepub fn detect_with(get_var: impl Fn(&str) -> Option<String>) -> ColorLevel
pub fn detect_with(get_var: impl Fn(&str) -> Option<String>) -> ColorLevel
Test color capability using a mockable environment lookup closure.
Trait Implementations§
Source§impl Clone for ColorLevel
impl Clone for ColorLevel
Source§fn clone(&self) -> ColorLevel
fn clone(&self) -> ColorLevel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ColorLevel
Source§impl Debug for ColorLevel
impl Debug for ColorLevel
Source§impl Default for ColorLevel
impl Default for ColorLevel
Source§fn default() -> ColorLevel
fn default() -> ColorLevel
Returns the “default value” for a type. Read more
impl Eq for ColorLevel
Source§impl Ord for ColorLevel
impl Ord for ColorLevel
Source§fn cmp(&self, other: &ColorLevel) -> Ordering
fn cmp(&self, other: &ColorLevel) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ColorLevel
impl PartialEq for ColorLevel
Source§impl PartialOrd for ColorLevel
impl PartialOrd for ColorLevel
impl StructuralPartialEq for ColorLevel
Auto Trait Implementations§
impl Freeze for ColorLevel
impl RefUnwindSafe for ColorLevel
impl Send for ColorLevel
impl Sync for ColorLevel
impl Unpin for ColorLevel
impl UnsafeUnpin for ColorLevel
impl UnwindSafe for ColorLevel
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