diff --git a/src/colour.rs b/src/colour.rs index 9b87a13..a045785 100644 --- a/src/colour.rs +++ b/src/colour.rs @@ -9,9 +9,7 @@ pub struct Colour { impl From<&str> for Colour { fn from(str: &str) -> Self { - let rgb = hex::decode(&str[str.len() - 6..]).unwrap(); - - Colour { red: rgb[0], green: rgb[1], blue: rgb[2] } + Self::from(hex::decode(&str[str.len() - 6..]).unwrap()) } }