summaryrefslogtreecommitdiffstats
path: root/src/parse_style.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-07-12 16:37:59 -0400
committerDan Davison <dandavison7@gmail.com>2020-07-13 10:43:41 -0400
commit3c1610ffd605bc775f160840ecb195449128e736 (patch)
tree06f670ac299a92330053f2ffac8af811baa1d5db /src/parse_style.rs
parentd99a64c8c383e196693e438652eb2ad5006e48bc (diff)
Refactor: simplify color parsing
Diffstat (limited to 'src/parse_style.rs')
-rw-r--r--src/parse_style.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/parse_style.rs b/src/parse_style.rs
index e24e7921..73a42c65 100644
--- a/src/parse_style.rs
+++ b/src/parse_style.rs
@@ -245,8 +245,7 @@ fn parse_ansi_term_style(
style.foreground = default.and_then(|s| s.ansi_term_style.foreground);
is_syntax_highlighted = default.map(|s| s.is_syntax_highlighted).unwrap_or(false);
} else {
- style.foreground =
- color::color_from_rgb_or_ansi_code_with_default(word, true_color);
+ style.foreground = color::parse_color(word, true_color);
}
seen_foreground = true;
} else if !seen_background {
@@ -261,8 +260,7 @@ fn parse_ansi_term_style(
background_is_auto = true;
style.background = default.and_then(|s| s.ansi_term_style.background);
} else {
- style.background =
- color::color_from_rgb_or_ansi_code_with_default(word, true_color);
+ style.background = color::parse_color(word, true_color);
}
seen_background = true;
} else {