aboutsummaryrefslogtreecommitdiffstats
path: root/src/ansi/colors.rs
blob: d14dc816fbc236070cad1521490bda6e0bde5c66 (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
27
28
macro_rules! color {
    ($($name: ident = $num:expr ;)*) => {
        $(
            #[allow(unused)]
            pub const $name: &str = concat!("\x1b[", stringify!($num), "m");
        )*
    };
}

color! {
    RESET = 0;
    BLACK_FG = 30;
    BLACK_BG = 40;
    RED_FG = 31;
    RED_BG = 41;
    GREEN_FG = 32;
    GREEN_BG = 42;
    YELLOW_FG = 33;
    YELLOW_BG = 43;
    BLUE_FG = 34;
    BLUE_BG = 44;
    MAGENTA_FG = 35;
    MAGENTA_BG = 45;
    CYAN_FG = 36;
    CYAN_BG = 46;
    WHITE_FG = 37;
    WHITE_BG = 47;
}