Skip to content

Commit

Permalink
Replace fixed colors by named ones so that it works well with any col…
Browse files Browse the repository at this point in the history
…or scheme
  • Loading branch information
Mélanie Chauvel committed Mar 30, 2018
1 parent 63a1035 commit 8f566fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/info/filetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ impl FileColours for FileExtensions {

Some(match file {
f if self.is_immediate(f) => Yellow.bold().underline(),
f if self.is_image(f) => Fixed(133).normal(),
f if self.is_video(f) => Fixed(135).normal(),
f if self.is_music(f) => Fixed(92).normal(),
f if self.is_lossless(f) => Fixed(93).normal(),
f if self.is_crypto(f) => Fixed(109).normal(),
f if self.is_document(f) => Fixed(105).normal(),
f if self.is_image(f) => Purple.normal(),
f if self.is_video(f) => Purple.bold(),
f if self.is_music(f) => Cyan.normal(),
f if self.is_lossless(f) => Cyan.bold(),
f if self.is_crypto(f) => Green.bold(),
f if self.is_document(f) => Green.normal(),
f if self.is_compressed(f) => Red.normal(),
f if self.is_temp(f) => Fixed(244).normal(),
f if self.is_compiled(f) => Fixed(137).normal(),
f if self.is_temp(f) => White.normal(),
f if self.is_compiled(f) => Yellow.normal(),
_ => return None,
})
}
Expand Down
15 changes: 7 additions & 8 deletions src/style/colours.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ansi_term::Style;
use ansi_term::Colour::{Red, Green, Yellow, Blue, Cyan, Purple, Fixed};
use ansi_term::Colour::{Black, Red, Green, Yellow, Blue, Cyan, Purple};

use output::render;
use output::file_name::Colours as FileNameColours;
Expand Down Expand Up @@ -152,11 +152,11 @@ impl Colours {
major: Green.bold(),
minor: Green.normal(),

scale_byte: Fixed(118).normal(),
scale_kilo: Fixed(190).normal(),
scale_mega: Fixed(226).normal(),
scale_giga: Fixed(220).normal(),
scale_huge: Fixed(214).normal(),
scale_byte: Green.normal(),
scale_kilo: Green.bold(),
scale_mega: Yellow.normal(),
scale_giga: Red.normal(),
scale_huge: Purple.normal(),
},

users: Users {
Expand All @@ -179,7 +179,7 @@ impl Colours {
typechange: Purple.normal(),
},

punctuation: Fixed(244).normal(),
punctuation: Black.bold(),
date: Blue.normal(),
inode: Purple.normal(),
blocks: Cyan.normal(),
Expand Down Expand Up @@ -400,4 +400,3 @@ impl FileNameColours for Colours {
fn symlink_path(&self) -> Style { self.symlink_path }
fn executable_file(&self) -> Style { self.filekinds.executable }
}

0 comments on commit 8f566fa

Please sign in to comment.