Skip to content

Commit

Permalink
Merge pull request #225 from liclac/color-default
Browse files Browse the repository at this point in the history
Derive Default for Color, TriColor and OctColor thanks to @liclac
  • Loading branch information
caemor authored Dec 16, 2024
2 parents 6b27f52 + a116a0e commit 1edb243
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,34 @@ impl OutOfColorRangeParseError {

/// Only for the Black/White-Displays
// TODO : 'color' is not a good name for black and white, rename it to BiColor/BWColor ?
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
pub enum Color {
/// Black color
Black,
/// White color
#[default]
White,
}

/// Only for the Black/White/Color-Displays
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
pub enum TriColor {
/// Black color
Black,
/// White color
#[default]
White,
/// Chromatic color
Chromatic,
}

/// For the 7 Color Displays
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
pub enum OctColor {
/// Black Color
Black = 0x00,
/// White Color
#[default]
White = 0x01,
/// Green Color
Green = 0x02,
Expand Down

0 comments on commit 1edb243

Please sign in to comment.