colors/
colors.rs

1use termio::*;
2
3fn main() {
4    let mut tcss = Termio::new();
5    
6    let tcss_content = r#"
7        @element "basic" {
8            color: red;
9            background: black;
10        }
11
12        @element "intense" {
13            color: i-red;
14            background: i-black;
15        }
16
17        @element "rgb" {
18            color: rgb(255, 0, 0);
19            background: rgb(0, 0, 0);
20        }
21
22        @element "code" {
23            color: 196;
24            background: 0;
25            border: solid rgb(6, 180, 49);
26        }
27    "#;
28
29    tcss.parse(tcss_content).unwrap();
30
31    println!("Basic colors:");
32    println!("{}", "Red text on black background".style("basic", &tcss));
33    
34    println!("\nIntense colors:");
35    println!("{}", "Intense red text on intense black background".style("intense", &tcss));
36    
37    println!("\nRGB colors:");
38    println!("{}", "RGB red text on RGB black background".style("rgb", &tcss));
39    
40    println!("\nColor codes:");
41    println!("{}", "Color code 196 (red) on code 0 (black)".style("code", &tcss));
42}