From 8a1b23ba79979d69257ff004ee567f89f30dff69 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sat, 21 Dec 2019 17:50:35 -0500 Subject: [PATCH] make RGB PartialEq --- lights/src/lib.rs | 2 +- lights/src/rgb.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lights/src/lib.rs b/lights/src/lib.rs index 47b67c9..7d6b51e 100644 --- a/lights/src/lib.rs +++ b/lights/src/lib.rs @@ -13,7 +13,7 @@ use core::borrow::Borrow; /// An RGB value in physical color space, which should be passed on to an LED for display. /// Not suitable for color operations, since its values won't be perceptually linear. /// See the [rgb] module for the former, and the [gamma] module to convert into this. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, PartialEq)] pub struct HardwareRgb(pub u8, pub u8, pub u8); /// Represents a string of lights which can be individually updated in linear order. diff --git a/lights/src/rgb.rs b/lights/src/rgb.rs index c54b6fd..64299b0 100644 --- a/lights/src/rgb.rs +++ b/lights/src/rgb.rs @@ -3,7 +3,7 @@ /// An RGB color value in some perceptual color space; /// ideally this will be gamma-corrected before display, /// but this form is better for doing gradient/fade/etc calculations on. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, PartialEq)] pub struct Rgb(pub u8, pub u8, pub u8); impl core::ops::Add for Rgb {