diff --git a/src/colorspace.rs b/src/colorspace.rs index 6b8b600..14706c2 100644 --- a/src/colorspace.rs +++ b/src/colorspace.rs @@ -1,4 +1,6 @@ -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +use std::fmt::{self, Debug}; + +#[derive(Copy, Clone, PartialEq, Eq, Hash)] pub struct ColorSpace { pub r_linear: bool, pub g_linear: bool, @@ -56,3 +58,13 @@ impl From for u8 { value.to_u8() } } + +impl Debug for ColorSpace { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "ColorSpace({}{}{}{})", + self.r_linear as u8, self.g_linear as u8, self.b_linear as u8, self.a_linear as u8 + ) + } +}