pub enum Color {
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
}Expand description
Color defines supported color types and provides static functions
§Examples
use gory::*;
print!("{} ", format!("\\e[1;{}m", Color::Red).red());
print!("{} ", "red".red());
println!();Variants§
Implementations§
Source§impl Color
impl Color
Sourcepub fn enabled() -> bool
pub fn enabled() -> bool
Is color enabled.
Determines if the environment has a tty attached and the TERM_COLOR environment
variable is either unset or is set to a truthy value i.e. not 0 and not some
case insensitive variation of false.
§Examples
use gory::*;
println!("{:?}", Color::enabled());Trait Implementations§
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
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