From a0751f21b0b39368daf7beded5194ebbcbfe5329 Mon Sep 17 00:00:00 2001 From: Esption Date: Mon, 3 Oct 2016 00:15:12 -0500 Subject: [PATCH] Add Debug to color structs and Clone to Rgb / Fg / Bg (#51) --- src/color.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/color.rs b/src/color.rs index 5361f0f..861b233 100644 --- a/src/color.rs +++ b/src/color.rs @@ -27,7 +27,7 @@ pub trait Color { macro_rules! derive_color { ($doc:expr, $name:ident, $value:expr) => { #[doc = $doc] - #[derive(Copy, Clone)] + #[derive(Copy, Clone, Debug)] pub struct $name; impl Color for $name { @@ -62,7 +62,7 @@ derive_color!("High-intensity light cyan.", LightCyan, "14"); derive_color!("High-intensity light white.", LightWhite, "15"); /// An arbitrary ANSI color value. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct AnsiValue(pub u8); impl AnsiValue { @@ -100,6 +100,7 @@ impl Color for AnsiValue { } /// A truecolor RGB. +#[derive(Debug, Clone)] pub struct Rgb(pub u8, pub u8, pub u8); impl Color for Rgb { @@ -115,6 +116,7 @@ impl Color for Rgb { } /// Reset colors to defaults. +#[derive(Debug)] pub struct Reset; impl Color for Reset { @@ -130,6 +132,7 @@ impl Color for Reset { } /// A foreground color. +#[derive(Debug, Clone)] pub struct Fg(pub C); impl fmt::Display for Fg { @@ -139,6 +142,7 @@ impl fmt::Display for Fg { } /// A background color. +#[derive(Debug, Clone)] pub struct Bg(pub C); impl fmt::Display for Bg {