summaryrefslogtreecommitdiff
path: root/src/term/color.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/term/color.rs')
-rw-r--r--src/term/color.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/term/color.rs b/src/term/color.rs
index 276a6897..0706f9df 100644
--- a/src/term/color.rs
+++ b/src/term/color.rs
@@ -101,24 +101,19 @@ impl List {
for r in 0..6 {
for g in 0..6 {
for b in 0..6 {
- // Index of the color is number of named colors + rgb
- let color_index = 16 + r + g + b;
-
// Override colors 16..232 with the config (if present)
if let Some(indexed_color) = colors
.indexed_colors
.iter()
- .find(|ic| ic.index == color_index)
+ .find(|ic| ic.index == index as u8)
{
self[index] = indexed_color.color;
- index += 1;
- continue;
+ } else {
+ self[index] = Rgb { r: if r == 0 { 0 } else { r * 40 + 55 },
+ b: if b == 0 { 0 } else { b * 40 + 55 },
+ g: if g == 0 { 0 } else { g * 40 + 55 },
+ };
}
-
- self[index] = Rgb { r: if r == 0 { 0 } else { r * 40 + 55 },
- b: if b == 0 { 0 } else { b * 40 + 55 },
- g: if g == 0 { 0 } else { g * 40 + 55 },
- };
index += 1;
}
}