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
29
30
31
32
33
34
35
36
37
pub struct ColorFg(AnsiBuilder);

impl ColorFg {
    pub fn bright_green(mut self) -> AnsiBuilder {
        self.0.0.push_str("\x1B[92m");
        self.0
    }

    pub fn gray(mut self) -> AnsiBuilder {
        self.0.0.push_str("\x1B[90m");
        self.0
    }

    pub fn white(mut self) -> AnsiBuilder {
        self.0.0.push_str("\x1B[37m");
        self.0
    }
}

pub struct ColorBg(AnsiBuilder);

impl ColorBg {
}

pub struct Color(pub AnsiBuilder);

impl Color {
    pub fn fg(self) -> ColorFg {
        ColorFg(self.0)
    }

    pub fn bg(self) -> ColorBg {
        ColorBg(self.0)
    }
}

use crate::AnsiBuilder;