prettyt 0.3.0

A lightweight, environment-aware ANSI terminal text styling library with automatic color capability detection.
Documentation
use prettyt::{Color, Style};

fn main() {
    // --- Advanced Typography and Text Attributes ---
    let title = Style::new().fg(Color::Cyan).bold().underline();
    let notice = Style::new().fg(Color::White).italic();
    let old_price = Style::new().fg(Color::BrightBlack).strikethrough();
    let new_price = Style::new().fg(Color::BrightGreen).bold();
    let metadata = Style::new().dim(); // Faint/decreased intensity

    println!("{}", title.apply("--- PRODUCT DISPATCH REPORT ---"));
    println!(
        "{}",
        notice.apply("Note: Delivery windows are subject to transit delays.")
    );
    println!();

    println!(
        "Price:   {} -> {} (Sale active)",
        old_price.apply("$49.99"),
        new_price.apply("$29.99")
    );
    println!(
        "{}",
        metadata.apply("Generated by system-node-04a (v1.2.0)")
    );

    println!();

    // --- Reverse Video / Inversion ---
    // Great for highlighted blocks, notifications, or text selections
    let alert_badge = Style::new()
        .fg(Color::BrightYellow)
        .bg(Color::Black)
        .invert(); // Swaps fg and bg colors natively

    let normal_text = Style::new().fg(Color::White);

    println!(
        "{} {}",
        alert_badge.apply(" ATTENTION "),
        normal_text.apply("Database backup will begin in 5 minutes.")
    );

    println!();

    // --- Composing Text Attributes with True Color ---
    let critical_err = Style::new()
        .fg(Color::Rgb(255, 60, 60)) // Vivid Coral/Red
        .bg(Color::Rgb(40, 10, 10)) // Deep Red tinted background
        .bold()
        .underline();

    let trace_info = Style::new().fg(Color::Rgb(140, 180, 255)).italic();

    println!(
        "{}",
        critical_err.apply("CRITICAL_CORE_FAILURE: Memory allocation panic in thread 'main'")
    );
    println!(
        " -> Location: {}",
        trace_info.apply("src/runtime/executor.rs:204")
    );
}