const_colors

Crates.ioconst_colors
lib.rsconst_colors
version0.1.0
sourcesrc
created_at2021-09-04 00:28:54.240917
updated_at2021-09-04 00:28:54.240917
descriptionFor when all you need, are colors in your terminal
homepage
repositoryhttps://github.com/StratusFearMe21/const_colors
max_upload_size
id446686
size4,018
(StratusFearMe21)

documentation

README

For when you just need colors

const_colors is a set of macros that allow you to have colors in your Linux terminal without the need to allocate anything to do so.

How to use

To use, simply use the concat! macro in your strings like so

concat!(red!(), "I'm red, make sure to end me", end!(), green!(), "Now I'm green", end!(), bold!(), blue!(), "Now I am bold blue", end!());

To use colors with non-constant values, simply use the format! macro in tandom with the concat! macro like so

format!(concat!("Server initialization ", bold!(), "{}", end!()));
println!(concat!("This also works with ", bold!(), "{}", end!(), "formatted data"));
Commit count: 3

cargo fmt