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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user