Enum terminal_graphics::display::colour::Colour
[−]
[src]
pub enum Colour { Black, Red, Green, Yellow, Blue, Magenta, Cyan, White, }
The Colour enum is used to set the colours in the Terminal
The available colours come from the ANSI_escape_codes https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
Variants
Black
Red
Green
Yellow
Blue
Magenta
Cyan
White
Methods
impl Colour
[src]
fn of(colour: &str) -> Colour
Get the enum value from a string
use terminal_graphics::Colour; let black = Colour::of("Black"); assert_eq!(Colour::Black, black);
fn get_codes(&self) -> (u32, u32)
Gets the values for the colour: from https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
use terminal_graphics::Colour; let red = Colour::Red; let (character_colour, background_colour) = red.get_codes(); assert_eq!(character_colour, 31); assert_eq!(background_colour, 41);
Trait Implementations
impl Copy for Colour
[src]
impl Clone for Colour
[src]
fn clone(&self) -> Colour
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more