@@ -1,4 +1,4 @@
1−use ansi_term::Colour::{Fixed, Green, Red, White, Yellow};
1+use ansi_term::Colour::{Fixed, Green, Red, Yellow};
22use ansi_term::Style;
33use app::Config;
44use console::AnsiCodeIterator;
@@ -9,8 +9,8 @@ use std::boxed::Box;
99use std::io::Write;
1010use std::vec::Vec;
1111use style::OutputWrap;
12−use syntect::highlighting;
13−use terminal::as_terminal_escaped;
12+use syntect::highlighting::{self, Theme};
13+use terminal::{as_terminal_escaped, to_ansi_color};
1414
1515pub struct Printer<'a> {
1616 handle: &'a mut Write,
@@ -24,9 +24,9 @@ pub struct Printer<'a> {
2424}
2525
2626impl<'a> Printer<'a> {
27− pub fn new(handle: &'a mut Write, config: &'a Config) -> Self {
27+ pub fn new(handle: &'a mut Write, config: &'a Config, theme: &Theme) -> Self {
2828 let colors = if config.colored_output {
29− Colors::colored()
29+ Colors::colored(theme, config.true_color)
3030 } else {
3131 Colors::plain()
3232 };
@@ -274,8 +274,7 @@ impl<'a> Printer<'a> {
274274 }
275275}
276276
277−const GRID_COLOR: u8 = 238;
278−const LINE_NUMBER_COLOR: u8 = 244;
277+const DEFAULT_GUTTER_COLOR: u8 = 238;
279278
280279#[derive(Default)]
281280pub struct Colors {
@@ -292,14 +291,20 @@ impl Colors {
292291 Colors::default()
293292 }
294293
295− fn colored() -> Self {
294+ fn colored(theme: &Theme, true_color: bool) -> Self {
295+ let gutter_color = theme
296+ .settings
297+ .gutter_foreground
298+ .map(|c| to_ansi_color(c, true_color))
299+ .unwrap_or(Fixed(DEFAULT_GUTTER_COLOR));
300+
296301 Colors {
297− grid: Fixed(GRID_COLOR).normal(),
298− filename: White.bold(),
302+ grid: gutter_color.normal(),
303+ filename: Style::new().bold(),
299304 git_added: Green.normal(),
300305 git_removed: Red.normal(),
301306 git_modified: Yellow.normal(),
302− line_number: Fixed(LINE_NUMBER_COLOR).normal(),
307+ line_number: gutter_color.normal(),
303308 }
304309 }
305310}