pub enum Color {
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
Byte(u8),
Default,
}
Expand description
The color of a Cell
.
Color::Default
represents the default color of the underlying terminal.
The eight basic colors may be used directly and correspond to 0x00..0x07 in the 8-bit (256)
color range; in addition, the eight basic colors coupled with Attr::Bold
correspond to
0x08..0x0f in the 8-bit color range.
Color::Byte(..)
may be used to specify a color in the 8-bit range.
§Examples
use rustty::Color;
// The default color.
let default = Color::Default;
// A basic color.
let red = Color::Red;
// An 8-bit color.
let fancy = Color::Byte(0x01);
// Basic colors are also 8-bit colors (but not vice-versa).
assert_eq!(red.as_byte(), fancy.as_byte())
Variants§
Implementations§
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 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