@@ -1,3 +1,5 @@
1+use ansi_term::Colour::{Fixed, Green, Red, White, Yellow};
2+use ansi_term::Style;
13use app::Config;
24use console::AnsiCodeIterator;
35use decorations::{Decoration, GridBorderDecoration, LineChangesDecoration, LineNumberDecoration};
@@ -9,7 +11,6 @@ use std::vec::Vec;
911use style::OutputWrap;
1012use syntect::highlighting;
1113use terminal::as_terminal_escaped;
12−use Colors;
1314
1415pub struct Printer<'a> {
1516 handle: &'a mut Write,
@@ -252,3 +253,33 @@ impl<'a> Printer<'a> {
252253 Ok(())
253254 }
254255}
256+
257+const GRID_COLOR: u8 = 238;
258+const LINE_NUMBER_COLOR: u8 = 244;
259+
260+#[derive(Default)]
261+pub struct Colors {
262+ pub grid: Style,
263+ pub filename: Style,
264+ pub git_added: Style,
265+ pub git_removed: Style,
266+ pub git_modified: Style,
267+ pub line_number: Style,
268+}
269+
270+impl Colors {
271+ fn plain() -> Self {
272+ Colors::default()
273+ }
274+
275+ fn colored() -> Self {
276+ Colors {
277+ grid: Fixed(GRID_COLOR).normal(),
278+ filename: White.bold(),
279+ git_added: Green.normal(),
280+ git_removed: Red.normal(),
281+ git_modified: Yellow.normal(),
282+ line_number: Fixed(LINE_NUMBER_COLOR).normal(),
283+ }
284+ }
285+}