Crates.io | rust-colors |
lib.rs | rust-colors |
version | 0.2.1 |
source | src |
created_at | 2024-06-09 19:11:49.798886 |
updated_at | 2024-06-10 11:57:23.419541 |
description | A library for parsing ANSI Strings to colors. |
homepage | https://redisgaming.vercel.app/ |
repository | https://github.com/RedIsGaming/rust-colors |
max_upload_size | |
id | 1266580 |
size | 6,273 |
A library for parsing ANSI Strings to colors. Built in Rust, open source and easy to use. Underneath are some examples of how you could use the functions.
You can reach out to me on Discord: RedIsGaming
Here is an example of how the main program can look:
use rust_colors::{Ansi, Color, Colors};
fn main() {
let colors = Ansi;
println!(
"The sky is {}, apples can be {}, do you like to touch {} grass?",
colors.color("blue", Colors::Blue),
colors.bold_color("red", Colors::Red),
colors.underline_color("green", Colors::Green),
);
}
Colors::Black,
Colors::Red,
Colors::Green,
Colors::Yellow,
Colors::Blue,
Colors::Purple,
Colors::Cyan,
Colors::White,
Colors::Default,
First clone the rust-colors project to any location you desire.
git clone https://github.com/RedIsGaming/rust-colors.git
Then switch to that directory and run Cargo.
cd rust-colors
cargo run