ansi_builder/
style.rs

1/// Style struct takes in the AnsiBuilder and set the correct escape sequence
2/// to fit the wanted style that is asked for in future text.
3///
4/// ## Example
5/// ```
6/// use ansi_builder::AnsiBuilder;
7///
8/// // "Hello" will be bold in the terminal.
9/// AnsiBuilder::new()
10///     .style().bold()
11///     .text("Hello")
12///     .println();
13/// ```
14pub struct Style(pub AnsiBuilder);
15
16impl Style {
17    ansi_sgr!(bold, "1");
18    ansi_sgr!(conceal, "8");
19    ansi_sgr!(double_underline,"21");
20    ansi_sgr!(dim, "2");
21    ansi_sgr!(encircle, "52");
22    ansi_sgr!(frame, "51");
23    ansi_sgr!(italic, "3");
24    ansi_sgr!(normal, "25");
25    ansi_sgr!(overline, "53");
26    ansi_sgr!(rapid_blink, "6");
27    ansi_sgr!(remove_blink, "25");
28    ansi_sgr!(remove_frame_and_encircle, "54");
29    ansi_sgr!(remove_italic, "23");
30    ansi_sgr!(remove_overline, "55");
31    ansi_sgr!(remove_strike, "29");
32    ansi_sgr!(remove_underline, "24");
33    ansi_sgr!(reveal, "28");
34    ansi_sgr!(slow_blink, "5");
35    ansi_sgr!(strike, "9");
36    ansi_sgr!(underline, "4");
37}
38
39use crate::AnsiBuilder;