Crates.io | coloriz |
lib.rs | coloriz |
version | 0.2.0 |
source | src |
created_at | 2021-05-24 16:17:51.693739 |
updated_at | 2021-06-15 15:47:40.971999 |
description | A simple library for colorful temrinal |
homepage | https://github.com/navierr/coloriz |
repository | https://github.com/navierr/coloriz |
max_upload_size | |
id | 401465 |
size | 209,182 |
Coloriz is a library for colorizing terminal outputs. It supports true colors and gradients.
You can easily make your terminal colorful!
Add this to your Cargo.toml :
[dependencies]
coloriz = "0.2.0"
use coloriz::{Colorize, Color};
fn main() {
let text = "Hello, world!";
println!("{}{}", text.bg(Color::BrightRed), text.fg(Color::Red));
println!("{}{}", text.fg(Color::Green), text.bg(Color::Green));
println!("{}{}", text.bg(Color::BrightYellow), text.fg(Color::Yellow));
println!("{}{}", text.fg(Color::BrightBlue), text.bg(Color::Blue));
println!("{}{}", text.bg(Color::BrightMagenta), text.fg(Color::Magenta));
println!("{}{}", text.fg(Color::BrightCyan), text.bg(Color::Cyan));
}
Document
More tests
Support Styles
Contributions are welcome! Feel free to open Issues and PRs.
MIT License
Copyright (c) 2021 navier