better view
This commit is contained in:
12
src/utils.rs
Normal file
12
src/utils.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use iced::Color;
|
||||
|
||||
pub fn string_to_color<S: AsRef<str>>(s: S) -> Color {
|
||||
match s.as_ref() {
|
||||
"Green" => Color::from_rgb(0.0, 1.0, 0.0),
|
||||
"Blue" => Color::from_rgb(0.0, 0.0, 1.0),
|
||||
"Cyan" => Color::from_rgb(0.0, 1.0, 1.0),
|
||||
"Yellow" => Color::from_rgb(1.0, 1.0, 0.0),
|
||||
"Pink" => Color::from_rgb(1.0, 0.0, 1.0),
|
||||
_ => Color::BLACK,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user