diff options
Diffstat (limited to 'vendor/colored/src/lib.rs')
-rw-r--r--[-rwxr-xr-x] | vendor/colored/src/lib.rs | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/vendor/colored/src/lib.rs b/vendor/colored/src/lib.rs index 4475320fc..71e042b44 100755..100644 --- a/vendor/colored/src/lib.rs +++ b/vendor/colored/src/lib.rs @@ -25,11 +25,9 @@ //! #![warn(missing_docs)] -extern crate atty; +extern crate is_terminal; #[macro_use] extern crate lazy_static; -#[cfg(windows)] -extern crate winapi; #[cfg(test)] extern crate rspec; @@ -38,6 +36,11 @@ mod color; pub mod control; mod style; +pub use self::customcolors::CustomColor; + +/// Custom colors support. +pub mod customcolors; + pub use color::*; use std::{borrow::Cow, fmt, ops::Deref}; @@ -174,6 +177,16 @@ pub trait Colorize { { self.color(Color::TrueColor { r, g, b }) } + fn custom_color(self, color: CustomColor) -> ColoredString + where + Self: Sized, + { + self.color(Color::TrueColor { + r: color.r, + g: color.g, + b: color.b, + }) + } fn color<S: Into<Color>>(self, color: S) -> ColoredString; // Background Colors fn on_black(self) -> ColoredString @@ -290,6 +303,16 @@ pub trait Colorize { { self.on_color(Color::TrueColor { r, g, b }) } + fn on_custom_color(self, color: CustomColor) -> ColoredString + where + Self: Sized, + { + self.on_color(Color::TrueColor { + r: color.r, + g: color.g, + b: color.b, + }) + } fn on_color<S: Into<Color>>(self, color: S) -> ColoredString; // Styles fn clear(self) -> ColoredString; @@ -299,10 +322,8 @@ pub trait Colorize { fn italic(self) -> ColoredString; fn underline(self) -> ColoredString; fn blink(self) -> ColoredString; - /// Historical name of `Colorize::reversed`. May be removed in a future version. Please use - /// `Colorize::reversed` instead + #[deprecated(since = "1.5.2", note = "Users should use reversed instead")] fn reverse(self) -> ColoredString; - /// This should be preferred to `Colorize::reverse`. fn reversed(self) -> ColoredString; fn hidden(self) -> ColoredString; fn strikethrough(self) -> ColoredString; |