Crates.io | ColorShell |
lib.rs | ColorShell |
version | 1.1.5 |
source | src |
created_at | 2024-05-16 08:21:53.8173 |
updated_at | 2024-05-21 08:22:54.035599 |
description | A small crate for coloring text for rust |
homepage | |
repository | |
max_upload_size | |
id | 1241895 |
size | 5,049 |
Colorshell is a rust library i made while i was bored. I have only been doing rust for 2.5 days. It lets you easily print colored text to the console
The color function will color text you give it. The color paramater takes in a color struct
Definition:
fn color(text: &'static str, clr: Color) -> String {
}
Get console input with this function choose what color the input will be
Definition:
fn color(iptext: &'static str, clr: Color) -> String {
}
Add Weight to text you give it Definition:
fn weigh(text: &'static str, wht: Weight) -> String {
}
Example:
use ColorShell::*;
fn main(){
println!("{}", weigh("Hello World", Weight::BOLD));
}
There are a few default colors:
Any others can be created with:
Color {
r: <red>,
g: <green>,
b: <blue>
}
There are a few default weights: