summaryrefslogtreecommitdiff
path: root/src/colour.rs
blob: 96f854d2e04773d936bbb7a29e901d562be998b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#[derive(Clone, Copy, Debug)]
pub enum Colour {
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
}

impl From<Colour> for termcolor::Color {
    fn from(c: Colour) -> Self {
        match c {
            Colour::Black   => termcolor::Color::Black,
            Colour::Red     => termcolor::Color::Red,
            Colour::Green   => termcolor::Color::Green,
            Colour::Yellow  => termcolor::Color::Yellow,
            Colour::Blue    => termcolor::Color::Blue,
            Colour::Magenta => termcolor::Color::Magenta,
            Colour::Cyan    => termcolor::Color::Cyan,
            Colour::White   => termcolor::Color::White,
        }
    }
}