color_output/output/fn.rs
1use crate::*;
2
3/// Executes the output operation with the given formatting.
4///
5/// [Official Documentation](https://docs.ltpp.vip/COLOR-OUTPUT/)
6///
7/// # Arguments
8///
9/// - `Output` - The output configuration
10pub fn output(output: Output) {
11 // Text
12 let text: &str = output.text;
13 let color: ColorType = output.color.clone();
14 let bg_color: ColorType = output.bg_color.clone();
15 let blod: bool = output.blod.clone();
16 // endl
17 let endl: bool = output.endl;
18 let mut task_list: Task<'_> = Task::default();
19 // Add text
20 task_list.add(Text {
21 text,
22 color,
23 bg_color,
24 blod,
25 endl,
26 });
27 // run
28 task_list.run_all();
29}