Crates.io | fancy |
lib.rs | fancy |
version | 0.3.1 |
source | src |
created_at | 2021-12-27 16:07:51.919467 |
updated_at | 2022-07-26 15:04:36.215054 |
description | Easily print colored text. |
homepage | |
repository | https://github.com/Foxcirc/fancy |
max_upload_size | |
id | 503763 |
size | 31,245 |
This crate makes it easy to print colored text to the terminal.
Color formatting can be done using the colorize!
macro. It takes a color format strig and expands to the original text, with the color modes replaced by an ANSI sequence.
Just like for format!
there is a shortcut macro printcol!
which prints the colored text directly to the console.
use fancy::printcoln;
printcoln!("[bold|cyan]Hello world[magenta]!");
All the color formating macros, do normal formatting too.
use fancy::printcoln;
printcoln!("[bold]{:x} {:x} [red]world!", 104, 105);
Note that not every console supports all features this crate offers. Some consoles like windows command prompt need you to enable support first and even then some default colors might not render correctly, depending on the color palette.
If you have any issues, you can tell me on github or via mail. I Hope this crate is usefull and functional for you :)