aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-03-31 04:09:17 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:26:39 -0800
commitc0ac06ff2ffefb01e6070104727a6fbf24857966 (patch)
treeb1320a45da6e61f3c973e32b077085bfb57c62d7 /src
parent59f167042adc748ed156bdd05bc0ecc64524501d (diff)
expose platform op color
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 35944a6..86c8a2d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -201,7 +201,7 @@ impl Default for ColorSettings {
data: color::Fg(&color::Yellow),
comparison: color::Fg(&color::Yellow),
invalid: color::Fg(&color::Red),
- platform: color::Fg(&color::Cyan),
+ platform: color::Fg(&color::LightBlue),
misc: color::Fg(&color::LightCyan),
register: color::Fg(&color::Cyan),
@@ -227,6 +227,7 @@ pub trait YaxColors {
fn data_op<T: Display>(&self, t: T) -> Colored<T>;
fn comparison_op<T: Display>(&self, t: T) -> Colored<T>;
fn invalid_op<T: Display>(&self, t: T) -> Colored<T>;
+ fn platform_op<T: Display>(&self, t: T) -> Colored<T>;
fn register<T: Display>(&self, t: T) -> Colored<T>;
fn number<T: Display>(&self, t: T) -> Colored<T>;
@@ -263,6 +264,9 @@ impl YaxColors for ColorSettings {
fn invalid_op<T: Display>(&self, t: T) -> Colored<T> {
Colored::Color(t, self.invalid)
}
+ fn platform_op<T: Display>(&self, t: T) -> Colored<T> {
+ Colored::Color(t, self.platform)
+ }
fn register<T: Display>(&self, t: T) -> Colored<T> {
Colored::Color(t, self.register)
@@ -339,6 +343,12 @@ impl <'a> YaxColors for Option<&'a ColorSettings> {
None => { Colored::Just(t) }
}
}
+ fn platform_op<T: Display>(&self, t: T) -> Colored<T> {
+ match self {
+ Some(colors) => { colors.platform_op(t) }
+ None => { Colored::Just(t) }
+ }
+ }
fn register<T: Display>(&self, t: T) -> Colored<T> {
match self {