mirror of
https://github.com/Feliix42/ssd1675.git
synced 2024-11-21 18:36:30 +00:00
Impl Default for Color
This commit is contained in:
parent
6871d3763a
commit
89b973b815
1 changed files with 6 additions and 2 deletions
|
@ -1,7 +1,11 @@
|
||||||
|
use core::default::Default;
|
||||||
|
|
||||||
|
|
||||||
/// Represents the state of a pixel in the display
|
/// Represents the state of a pixel in the display
|
||||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||||
pub enum Color {
|
pub enum Color {
|
||||||
Black,
|
Black,
|
||||||
|
#[default]
|
||||||
White,
|
White,
|
||||||
Red,
|
Red,
|
||||||
}
|
}
|
||||||
|
@ -37,7 +41,7 @@ impl From<RawU8> for Color {
|
||||||
match value.into_inner() {
|
match value.into_inner() {
|
||||||
0 => Color::Black,
|
0 => Color::Black,
|
||||||
_ => Color::White,
|
_ => Color::White,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue