Repository: eza-community/eza (language: rust)

Issue:
bug: Size unit color changes when --color-scale=age --color-scale-mode=fixed is used
Another `--color-scale` bug: I would expect when using `--color-scale=age`, `--color-scale-mode` should not affect the display of file size. But it does: `--color-scale-mode=fixed` changes the color of the size units:

![image](https://github.com/eza-community/eza/assets/56895621/041099cd-bb98-468f-a6ca-8b219aaaca6d)

Note that specifying `gradient` (the default anyway) doesn't affect the size units.

Normally I use `EXA_COLORS` since bright yellow is unreadable in my terminal theme, but here I have it unset.

May or may not have something to do with https://github.com/eza-community/eza/issues/633 and https://github.com/eza-community/eza/issues/682.

```
$ eza --version
eza - A modern, maintained replacement for ls
v0.16.0 [+git]
https://github.com/eza-community/eza
$ hostnamectl 
 Static hostname: rich-holmes-desktop
       Icon name: computer-desktop
         Chassis: desktop
      Machine ID: ...
         Boot ID: ...
Operating System: Linux Mint 21.2                 
          Kernel: Linux 5.15.0-88-generic
    Architecture: x86-64
 Hardware Vendor: System76
  Hardware Model: Wild Dog Pro
```




Discussion / hints:

Fix patch:
diff --git a/src/output/render/size.rs b/src/output/render/size.rs
index e36260f81..be7aa937d 100644
--- a/src/output/render/size.rs
+++ b/src/output/render/size.rs
@@ -23,7 +23,6 @@ impl f::Size {
             Self::DeviceIDs(ref ids) => return ids.render(colours),
         };
 
-        let gradient_style = colours.major();
         let is_gradient_mode =
             color_scale_info.is_some_and(|csi| csi.options.mode == ColorScaleMode::Gradient);
 
@@ -44,7 +43,7 @@ impl f::Size {
                 return if is_gradient_mode {
                     let csi = color_scale_info.unwrap();
                     TextCell::paint(
-                        csi.adjust_style(gradient_style, size as f32, csi.size),
+                        csi.adjust_style(colours.size(prefix), size as f32, csi.size),
                         string,
                     )
                 } else {
@@ -59,7 +58,7 @@ impl f::Size {
                 return if is_gradient_mode {
                     let csi = color_scale_info.unwrap();
                     TextCell::paint(
-                        csi.adjust_style(gradient_style, size as f32, csi.size),
+                        csi.adjust_style(colours.size(None), size as f32, csi.size),
                         numerics.format_int(b),
                     )
                 } else {
@@ -82,9 +81,9 @@ impl f::Size {
             contents: if is_gradient_mode {
                 let csi = color_scale_info.unwrap();
                 vec![
-                    csi.adjust_style(gradient_style, size as f32, csi.size)
+                    csi.adjust_style(colours.size(Some(prefix)), size as f32, csi.size)
                         .paint(number),
-                    csi.adjust_style(gradient_style, size as f32, csi.size)
+                    csi.adjust_style(colours.size(Some(prefix)), size as f32, csi.size)
                         .paint(symbol),
                 ]
             } else {
diff --git a/src/theme/default_theme.rs b/src/theme/default_theme.rs
index 13f5b27fb..4afdbe5fa 100644
--- a/src/theme/default_theme.rs
+++ b/src/theme/default_theme.rs
@@ -1,7 +1,8 @@
 use ansiterm::Colour::*;
 use ansiterm::Style;
+use std::default::Default;
 
-use crate::output::color_scale::ColorScaleOptions;
+use crate::output::color_scale::{ColorScaleMode, ColorScaleOptions};
 use crate::theme::ui_styles::*;
 
 impl UiStyles {
@@ -124,10 +125,10 @@ impl UiStyles {
 
 impl Size {
     pub fn colourful(scale: ColorScaleOptions) -> Self {
-        if scale.size {
-            Self::colourful_gradient()
-        } else {
+        if scale.size && scale.mode == ColorScaleMode::Fixed {
             Self::colourful_fixed()
+        } else {
+            Self::colourful_gradient()
         }
     }
 


Test patch: