Impl Default for Color

This commit is contained in:
Felix Suchert 2022-08-06 16:32:19 +02:00
parent 6871d3763a
commit 89b973b815
Signed by: feliix42
GPG key ID: 24363525EA0E8A99

View file

@ -1,7 +1,11 @@
use core::default::Default;
/// Represents the state of a pixel in the display
#[derive(Clone, Copy, PartialEq, Debug)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub enum Color {
Black,
#[default]
White,
Red,
}
@ -37,7 +41,7 @@ impl From<RawU8> for Color {
match value.into_inner() {
0 => Color::Black,
_ => Color::White,
}
}
}
}