Skip to content

Commit

Permalink
fix: parse color bug for rgb (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
InioX committed Aug 29, 2024
1 parent b73982a commit 994e17e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/color/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 994e17e

Please sign in to comment.