This crate is the simplest yet ergonomic way to add color to your terminal:
use simply_colored::*;
println!("{BLUE}{BOLD}Simply colored!")
Effect | Type |
---|---|
Italic | {ITALIC}Simply colored! |
Bold 68B5 strong> | {BOLD}Simply colored! |
Underline | {UNDERLINE}Simply colored! |
Blink | {BLINK}Simply colored! |
Reverse | {REVERSE}Simply colored! |
{STRIKETHROUGH}Simply colored! |
|
Dim | {DIM}Simply colored! |
Hide | {HIDE}Simply colored! |
Reset all styles | {RESET}Simply colored! |
All effects can be prefixed with NO_
to disable e.g. NO_BOLD
.
If you want links in the terminal, all you need is:
fn hyperlink(link: impl core::fmt::Display, text: impl core::fmt::Display) -> String {
format!("\x1b]8;;{link}\x1b\\{text}\x1b]8;;\x1b\\")
}
Example usage:
println!(
"Check out simply_colored on {}!",
hyperlink(
"https://github.com/nik-rev/simply-colored",
"GitHub"
)
);