Crates.io | clwind |
lib.rs | clwind |
version | 0.1.0 |
source | src |
created_at | 2024-07-13 21:42:49.291997 |
updated_at | 2024-07-13 21:42:49.291997 |
description | TailwindCSS like utility for CLI |
homepage | |
repository | https://github.com/CatalinIuga/clwind/ |
max_upload_size | |
id | 1302625 |
size | 24,553 |
ANSII color codes are a pain to remember, and just like plain CSS, it can take more time to write than it should. This is a simple API that allows you to add colors and styles to your CLI text with a TailwindCSS-like syntax.
cargo add clwind
use clwind::{clw, Color::Hex};
fn main() {
let ansii_formated = clw("Hello, World!")
.bg_bright_red()
.text(Hex(0xf2f2f2))
.font_bold()
.font_underline();
println!("{}", ansii_formated);
}
black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
; and the bright_
prefixes for each of them.Hex(0xf2f2f2)
RGB(255, 255, 255)
Color256(255)
MIT