Crates.io | ansi_brush |
lib.rs | ansi_brush |
version | 0.0.31 |
source | src |
created_at | 2022-09-27 03:41:12.800695 |
updated_at | 2022-09-27 04:43:12.034207 |
description | Ultra lightweight ANSI styling |
homepage | https://github.com/BumpyBill/jewel/tree/main/ansi_brush |
repository | https://github.com/BumpyBill/jewel/tree/main/ansi_brush |
max_upload_size | |
id | 674681 |
size | 7,053 |
Ultra lightweight ANSI styling
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());
}