From 8f566fa21ff99f82ebf88f71309a352ca078b3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lanie=20Chauvel?= Date: Fri, 30 Mar 2018 15:36:15 +0200 Subject: [PATCH] Replace fixed colors by named ones so that it works well with any color scheme --- src/info/filetype.rs | 16 ++++++++-------- src/style/colours.rs | 15 +++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/info/filetype.rs b/src/info/filetype.rs index e1d3b2dce..c165212d5 100644 --- a/src/info/filetype.rs +++ b/src/info/filetype.rs @@ -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, }) } diff --git a/src/style/colours.rs b/src/style/colours.rs index 59b6d1911..d55c59b27 100644 --- a/src/style/colours.rs +++ b/src/style/colours.rs @@ -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; @@ -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 { @@ -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(), @@ -400,4 +400,3 @@ impl FileNameColours for Colours { fn symlink_path(&self) -> Style { self.symlink_path } fn executable_file(&self) -> Style { self.filekinds.executable } } -