Skip to main content

never/
never.rs

1//! # Styling is never active
2//!
3//! Running this example in terminal will display white text:
4//!
5//! ```shell
6//! cargo run --example never
7//! ```
8//!
9//! Redirecting the output to another process will also print white text:
10//!
11//! ```shell
12//! cargo run --example never | cat
13//! ```
14
15use antex::{StyledText, Text};
16
17fn main() {
18  println!(
19    "{}",
20    Text::off()
21      .s("Never colored:\n")
22      .black()
23      .s(" 0 ")
24      .red()
25      .s(" 1 ")
26      .green()
27      .s(" 2 ")
28      .yellow()
29      .s(" 3 ")
30      .blue()
31      .s(" 4 ")
32      .magenta()
33      .s(" 5 ")
34      .cyan()
35      .s(" 6 ")
36      .white()
37      .s(" 7 ")
38      .reset()
39  );
40}