From 994e17e1c2b3f50a9919402d3e5e66df392889f0 Mon Sep 17 00:00:00 2001 From: InioX Date: Thu, 29 Aug 2024 12:03:57 +0200 Subject: [PATCH] fix: parse color bug for rgb (#107) --- src/color/color.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/color/color.rs b/src/color/color.rs index 95d5c93..9c4db84 100644 --- a/src/color/color.rs +++ b/src/color/color.rs @@ -115,7 +115,13 @@ pub fn get_source_color_from_color( Ok(Argb::from_str(string).expect("Invalid hex color string provided")) } ColorFormat::Rgb { string } => { - Ok(string.parse().expect("Invalid rgb color string provided")) + let rgb = Rgb::from_str(string).expect("Invalid rgb color string provided"); + Ok(Argb { + red: rgb.red() as u8, + green: rgb.green() as u8, + blue: rgb.blue() as u8, + alpha: 255, + }) } ColorFormat::Hsl { string } => { let rgb: Rgb = Hsl::from_str(string)