mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 17:39:35 +00:00
Rewrite project from Python to Rust and add Windows/MacOS supports
This commit is contained in:
16
src/utils/text.rs
Normal file
16
src/utils/text.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
pub const RESET: &str = "\x1b[0m";
|
||||
|
||||
pub const BOLD: &str = "\x1b[1m";
|
||||
|
||||
pub const BRIGHT_RED: &str = "\x1b[91m";
|
||||
pub const BRIGHT_GREEN: &str = "\x1b[92m";
|
||||
pub const BRIGHT_YELLOW: &str = "\x1b[93m";
|
||||
pub const BRIGHT_CYAN: &str = "\x1b[96m";
|
||||
|
||||
pub fn colored(msg: &str, style: &str) -> String {
|
||||
format!("{style}{msg}{RESET}")
|
||||
}
|
||||
|
||||
pub fn printc(msg: &str, style: &str) {
|
||||
println!("{style}{msg}{RESET}");
|
||||
}
|
||||
Reference in New Issue
Block a user