Gave up on the idea of colored script visualizations for now
This commit is contained in:
parent
7e7cd5d7b6
commit
837f611955
1 changed files with 0 additions and 28 deletions
|
@ -1,28 +0,0 @@
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
use colored::Colorize;
|
|
||||||
|
|
||||||
fn add_color(input: String) -> String {
|
|
||||||
let map = [
|
|
||||||
("number", "magenta"),
|
|
||||||
("green", "blue"),
|
|
||||||
].iter().cloned().collect::<HashMap<&str, &str>>();
|
|
||||||
|
|
||||||
let mut colored = String::new();
|
|
||||||
|
|
||||||
for word in input.split(' ') {
|
|
||||||
if let Some(num) = word.parse::<i32>().ok() {
|
|
||||||
colored.push_str(&format!("{:032b}", num));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
colored
|
|
||||||
}
|
|
||||||
|
|
||||||
fn handle_color(input: &str, color: &str) -> String {
|
|
||||||
match color {
|
|
||||||
"magenta" => input.magenta().to_string(),
|
|
||||||
"blue" => input.blue().to_string(),
|
|
||||||
_ => input.to_string(),
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue