Crates.io | colorful-console |
lib.rs | colorful-console |
version | 0.3.0 |
source | src |
created_at | 2024-10-20 11:17:07.625511 |
updated_at | 2024-10-22 14:01:54.394631 |
description | A simple way to get colored text in the console! |
homepage | |
repository | |
max_upload_size | |
id | 1416161 |
size | 22,063 |
A simple crate made to add a little bit of color to your basic terminal. Can be used to color your terminal, but is best used for making logging look both clean, but also convey enough information.
use colorful_console::*; // Imports the crate
fn main() {
// Prints "Starting" in the standard color (Color::Reset)
console::log("Starting", Color::Reset);
// Shows how to use the `color_wrap()` function
console::warn(&*format!("Could {} instantiate", color_wrap("not", Color::Red)), Color::Reset);
console::error("Something went wrong, restarting soon", Color::Reset);
// Clears the terminal screen
clear_terminal();
}