example/
example.rs

1use ansi_escape_codes::{ASCIIControlCode, ControlSequencePart, ControlSequenceInducerParameter, SelectGraphicRenditionParameter, ForegroundColor, Color, EscapeSequence, BackgroundColor, BrightForegroundColor };
2
3fn main() {
4    let params1: Vec<SelectGraphicRenditionParameter> = vec![
5        //SelectGraphicRenditionParameter::SetForegroundColorParameter(ForegroundColor::BlueForeground),
6        SelectGraphicRenditionParameter::SetForegroundColorParameter(
7            ForegroundColor::ForegroundColor(
8                Color::Color256(44)
9            )
10        ),
11        SelectGraphicRenditionParameter::SetBrightForegroundColorParameter(
12            BrightForegroundColor::BrightBlueForeground
13        ),
14        SelectGraphicRenditionParameter::SetBackgroundColorParameter(
15            BackgroundColor::BackgroundColor(
16                Color::RGB(255, 0, 127)
17            )
18        ),
19        SelectGraphicRenditionParameter::BoldParameter,
20        SelectGraphicRenditionParameter::ItalicParameter,
21    ];
22    let params2: Vec<SelectGraphicRenditionParameter> = vec![
23        //SelectGraphicRenditionParameter::SetForegroundColorParameter(ForegroundColor::BlueForeground),
24        SelectGraphicRenditionParameter::SetForegroundColorParameter(
25            ForegroundColor::ForegroundColor(
26                Color::Color256(44)
27            )
28        ),
29        SelectGraphicRenditionParameter::SetBrightForegroundColorParameter(
30            BrightForegroundColor::BrightBlueForeground
31        ),
32        SelectGraphicRenditionParameter::SetBackgroundColorParameter(
33            BackgroundColor::BackgroundColor(
34                Color::RGB(255, 0, 127)
35            )
36        ),
37        SelectGraphicRenditionParameter::BoldParameter,
38        SelectGraphicRenditionParameter::ItalicParameter,
39    ];
40    println!(
41        "{}test{}test2!{}test3{}",
42        EscapeSequence::SelectGraphicRenditionSequence(params1).to_string(),
43        EscapeSequence::ResetColorsSequence.to_string(),
44        EscapeSequence::SelectGraphicRenditionSequence(params2).to_string(),
45        ASCIIControlCode::CarriageReturnCode.to_string()
46    );
47    //println!("\x1b[55;2mwoo");
48}