ansi_brush

Crates.ioansi_brush
lib.rsansi_brush
version0.0.31
sourcesrc
created_at2022-09-27 03:41:12.800695
updated_at2022-09-27 04:43:12.034207
descriptionUltra lightweight ANSI styling
homepagehttps://github.com/BumpyBill/jewel/tree/main/ansi_brush
repositoryhttps://github.com/BumpyBill/jewel/tree/main/ansi_brush
max_upload_size
id674681
size7,053
bumpy (BumpyBill)

documentation

https://docs.rs/ansi_brush/

README

ansi_brush

Ultra lightweight ANSI styling

Examples

use ansi_brush::Style;

fn main()  {
    println!("{} {}", "Hello,".light_cyan().bold(), "World!".reset());
    // always put "reset" LAST after each style to revert the previous line's styles
    println!(
        "{} {} {} {} {} {} {} {}",
        "Bold".bold(),
        "Faint".faint().reset(),
        "Italic".italic().reset(),
        "Underline".underline().reset(),
        "Slow Blink".slow_blink().reset(),
        "Rapid Blink".rapid_blink().reset(),
        "Reverse".reverse().reset(),
        "Strike".strike().reset()
    );
    // use conclude to stop background bleeding into next lines (try it without conclude!)
    println!("{}", "Goodbye, Mars!".bg_red().underline().italic().conclude().reset());
}

TODO

  • 8 colors
  • 16 colors
  • Macro
  • 256 colors
  • Backgrounds
  • Styling
  • RGB colors
Commit count: 0

cargo fmt