aboutsummaryrefslogtreecommitdiff
path: root/src/ansi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansi.rs')
-rw-r--r--src/ansi.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ansi.rs b/src/ansi.rs
index 089bc277..8ff0a2e4 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -349,6 +349,22 @@ pub enum NamedColor {
Background,
}
+impl NamedColor {
+ pub fn to_bright(&self) -> Self {
+ match *self {
+ NamedColor::Black => NamedColor::BrightBlack,
+ NamedColor::Red => NamedColor::BrightRed,
+ NamedColor::Green => NamedColor::BrightGreen,
+ NamedColor::Yellow => NamedColor::BrightYellow,
+ NamedColor::Blue => NamedColor::BrightBlue,
+ NamedColor::Magenta => NamedColor::BrightMagenta,
+ NamedColor::Cyan => NamedColor::BrightCyan,
+ NamedColor::White => NamedColor::BrightWhite,
+ val => val
+ }
+ }
+}
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum Color {
Named(NamedColor),