feat: string parsers developed for all formats with strict regex

NOTE: this will be diluted down in order to admit any type of weird
string
This commit is contained in:
2025-08-15 17:44:36 +02:00
parent 5ffeee7851
commit 2fc069ca8e
8 changed files with 266 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
use clipboard::ClipboardContext;
use clipboard::ClipboardProvider;
use crate::color::Color;
use crate::color::HSV;
use crate::color::RGB;
@@ -20,4 +21,11 @@ fn main() {
let color = RGB::new(220, 10, 50);
let hsv_color = HSV::from(RGB::new(220, 10, 50));
println!("RGB color: {}, HSV Color: {}", color, hsv_color);
Color::try_parse("#F2FA01".to_string());
Color::try_parse("rgb(1, 3,4)".to_string());
Color::try_parse("rgb(1,3 ,4)".to_string());
Color::try_parse("rgb(1,F,4)".to_string());
Color::try_parse("hsl(100,100%,40%)".to_string());
Color::try_parse("hsl(100,100%,40)".to_string());
}