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

Methods

impl Colour
[src]

Get the enum value from a string

use terminal_graphics::Colour;

let black = Colour::of("Black");
assert_eq!(Colour::Black, black);

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Colour
[src]

Formats the value using the given formatter.

impl PartialEq for Colour
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.