Search
 
SCRIPT & CODE EXAMPLE
 

RUST

rust colorful terminal

// For your cargo.toml
[dependencies]
colored = "2"

// For your .rs file
use colored::*;

// Examples:
"this is blue".blue();
"this is red".red();
"this is red on blue".red().on_blue();
"this is also red on blue".on_blue().red();
"you can use truecolor values too!".truecolor(0, 255, 136);
"background truecolor also works :)".on_truecolor(135, 28, 167);
"bright colors are welcome as well".on_bright_blue().bright_red();
"you can also make bold comments".bold();
println!("{} {} {}", "or use".cyan(), "any".italic().yellow(), "string type".cyan());
"or change advice. This is red".yellow().blue().red();
"or clear things up. This is default color and style".red().bold().clear();
"purple and magenta are the same".purple().magenta();
"and so are normal and clear".normal().clear();
"you can specify color by string".color("blue").on_color("red");
String::from("this also works!").green().bold();
format!("{:30}", "format works as expected. This will be padded".blue());
format!("{:.3}", "and this will be green but truncated to 3 chars".green());
Comment

PREVIOUS NEXT
Code Example
Rust :: rust trait 
Rust :: uuid from string rust 
Rust :: const generics in rust 
Rust :: struct in rust 
Rust :: Pushing Array values to a Vector in Rust 
Rust :: how to make a sorting algorithim rust 
Rust :: Project Euler #1 Multiples of 3 or 5 
Rust :: rust get char at index 
Rust :: rust•armanriazi•concept•semantic 
Rust :: rust•armanriazi•type•wraper•mutable 
Rust :: get last index of string rust 
Rust :: how to create an integer in rust 
Rust :: armanriazi•rust•unsafe•extern•mangling 
Rust :: rust Clean way to get Option::unwrap_or_else behaviour with an Option<&T 
Rust :: rust get items in a list 
Rust :: armanriazi•rust•concept•pattern•newtype 
Rust :: rust•armanriazi•generic 
Lua :: roblox studio teleport on collision 
Lua :: lowercase lua 
Lua :: lua string to number 
Lua :: lua float to int 
Lua :: prompt game pass purchase 
Lua :: prompt developer product purchase roblox 
Lua :: lua clear table 
Lua :: Tool script example for lua 
Lua :: lua split 
Lua :: gettable 
Lua :: how do i use the love errors module lua assist 
Matlab :: anonymous function matlab 
Matlab :: matlab stop running function 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =