use prettyt::{Color, Style};
fn main() {
let error = Style::new().fg(Color::BrightRed).bold();
let success = Style::new().fg(Color::BrightGreen).bold();
let warning = Style::new().fg(Color::Yellow);
let muted = Style::new().fg(Color::BrightBlack);
println!("{} Something went wrong", error.apply("[ERROR]"));
println!("{} Build passed in 0.43s", success.apply("[OK]"));
println!("{} Deprecated API used", warning.apply("[WARN]"));
println!("{}", muted.apply("-- details omitted --"));
println!();
let header = Style::new()
.fg(Color::Ansi256(220)) .bg(Color::Ansi256(235)) .bold();
println!("{}", header.apply(" prettyt color showcase "));
println!();
let coral = Style::new().fg(Color::Rgb(255, 100, 80));
let teal = Style::new().fg(Color::Rgb(64, 200, 180));
let violet = Style::new().fg(Color::Rgb(180, 80, 255));
println!(
"{} {} {}",
coral.apply("coral"),
teal.apply("teal"),
violet.apply("violet"),
);
println!();
let timestamp = Style::new().fg(Color::BrightBlack);
let level_ok = Style::new().fg(Color::Green);
let message = Style::new().fg(Color::White);
let ts = timestamp.apply("[12:34:56]");
let lvl = level_ok.apply("INFO ");
let msg = message.apply("Server started on port 8080");
println!("{} {} {}", ts, lvl, msg);
let highlight = Style::new().fg(Color::Cyan).bold();
println!("Result: {}", highlight.apply(&42));
println!("Uptime: {}", highlight.apply(&99.97));
}