#![deny(missing_docs)]
-#[cfg(test)]
-use doc_comment::doctest;
-#[cfg(test)]
-doctest!("../README.md");
+// #[cfg(doctest)]
+// use doc_comment::doctest;
+// #[cfg(doctest)]
+// doctest!("../README.md");
use std::env;
use std::error;
if spec.bold {
self.write_str("\x1B[1m")?;
}
+ if spec.dimmed {
+ self.write_str("\x1B[2m")?;
+ }
if spec.italic {
self.write_str("\x1B[3m")?;
}
bold: bool,
intense: bool,
underline: bool,
+ dimmed: bool,
italic: bool,
reset: bool,
}
bold: false,
intense: false,
underline: false,
+ dimmed: false,
italic: false,
reset: true,
}
self
}
+ /// Get whether this is dimmed or not.
+ ///
+ /// Note that the dimmed setting has no effect in a Windows console.
+ pub fn dimmed(&self) -> bool {
+ self.dimmed
+ }
+
+ /// Set whether the text is dimmed or not.
+ ///
+ /// Note that the dimmed setting has no effect in a Windows console.
+ pub fn set_dimmed(&mut self, yes: bool) -> &mut ColorSpec {
+ self.dimmed = yes;
+ self
+ }
+
/// Get whether this is italic or not.
///
/// Note that the italic setting has no effect in a Windows console.
&& self.bg_color.is_none()
&& !self.bold
&& !self.underline
+ && !self.dimmed
&& !self.italic
&& !self.intense
}
self.bold = false;
self.underline = false;
self.intense = false;
+ self.dimmed = false;
self.italic = false;
}
for underline in vec![false, true] {
for intense in vec![false, true] {
for italic in vec![false, true] {
- let mut color = ColorSpec::new();
- color.set_fg(fg);
- color.set_bg(bg);
- color.set_bold(bold);
- color.set_underline(underline);
- color.set_intense(intense);
- color.set_italic(italic);
- result.push(color);
+ for dimmed in vec![false, true] {
+ let mut color = ColorSpec::new();
+ color.set_fg(fg);
+ color.set_bg(bg);
+ color.set_bold(bold);
+ color.set_underline(underline);
+ color.set_intense(intense);
+ color.set_dimmed(dimmed);
+ color.set_italic(italic);
+ result.push(color);
+ }
}
}
}