From 6871d3763a1b7677b39aaaa73787234738a2b1ee Mon Sep 17 00:00:00 2001 From: Felix Wittwer Date: Fri, 5 Aug 2022 21:35:04 +0200 Subject: [PATCH] Impl From for Color --- src/color.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/color.rs b/src/color.rs index 6c915fd..3859d1d 100644 --- a/src/color.rs +++ b/src/color.rs @@ -30,6 +30,17 @@ impl From for Color { } } +impl From for Color { + fn from(value: RawU8) -> Self { + // NOTE(feliix42): This is a very ... liberal mapping of colors and may be refined at some + // point + match value.into_inner() { + 0 => Color::Black, + _ => Color::White, + } + } +} + #[cfg(feature = "graphics")] impl From for Color { fn from(value: BinaryColor) -> Self {