diff options
| -rw-r--r-- | src/utils/colour.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/colour.rs b/src/utils/colour.rs index b52af9a..cea6f45 100644 --- a/src/utils/colour.rs +++ b/src/utils/colour.rs @@ -227,6 +227,11 @@ impl From<u64> for Colour { fn from(value: u64) -> Colour { Colour(value as u32) } } +impl From<(u8, u8, u8)> for Colour { + /// Constructs a Colour from rgb. + fn from((r, g,b): (u8, u8, u8)) -> Self { Colour::from_rgb(r, g, b) } +} + colour! { /// Creates a new `Colour`, setting its RGB value to `(111, 198, 226)`. blitz_blue, 0x6FC6E2; |