better view

This commit is contained in:
2025-07-05 20:28:00 +02:00
parent c008eadfe9
commit bc528b63d4
4 changed files with 76 additions and 52 deletions

12
src/utils.rs Normal file
View 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,
}
}