Enum ptree::style::Color [−][src]
pub enum Color {
Black,
Red,
Green,
Yellow,
Blue,
Purple,
Cyan,
White,
Fixed(u8),
RGB(u8, u8, u8),
Named(String),
}
Expand description
A colour is one specific type of ANSI escape code, and can refer to either the foreground or background colour.
These use the standard numeric sequences. See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
Variants
Color #0 (foreground code 30
, background code 40
).
This is not necessarily the background colour, and using it as one may render the text hard to read on terminals with dark backgrounds.
Color #1 (foreground code 31
, background code 41
).
Color #2 (foreground code 32
, background code 42
).
Color #3 (foreground code 33
, background code 43
).
Color #4 (foreground code 34
, background code 44
).
Color #5 (foreground code 35
, background code 45
).
Color #6 (foreground code 36
, background code 46
).
Color #7 (foreground code 37
, background code 47
).
As above, this is not necessarily the foreground colour, and may be hard to read on terminals with light backgrounds.
Fixed(u8)
A colour number from 0 to 255, for use in 256-colour terminal environments.
- Colors 0 to 7 are the
Black
toWhite
variants respectively. These colours can usually be changed in the terminal emulator. - Colors 8 to 15 are brighter versions of the eight colours above. These can also usually be changed in the terminal emulator, or it could be configured to use the original colours and show the text in bold instead. It varies depending on the program.
- Colors 16 to 231 contain several palettes of bright colours, arranged in six squares measuring six by six each.
- Colors 232 to 255 are shades of grey from black to white.
It might make more sense to look at a colour chart.
Tuple Fields of Fixed
0: u8
A 24-bit RGB color, as specified by ISO-8613-3.
Named(String)
A named color, as supported by tint
.
Tuple Fields of Named
0: String
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Color
impl UnwindSafe for Color
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.