diff --git a/src/canvas.rs b/src/canvas.rs index 9eaa29f9..c70ae720 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -2,7 +2,7 @@ use crate::{ app::{self, data_harvester::processes::ProcessHarvest}, constants::*, data_conversion::{ConvertedCpuData, ConvertedProcessData}, - utils::{error, gen_util::*}, + utils::error, }; use std::cmp::max; use std::collections::HashMap; @@ -15,10 +15,8 @@ use tui::{ Terminal, }; -const STANDARD_FIRST_COLOUR: Color = Color::Rgb(150, 106, 253); -const STANDARD_SECOND_COLOUR: Color = Color::LightYellow; -const GOLDEN_RATIO: f32 = 0.618_034; // Approx, good enough for use (also Clippy gets mad if it's too long) - +mod canvas_colours; +use canvas_colours::*; // Headers const CPU_LEGEND_HEADER: [&str; 2] = ["CPU", "Use%"]; const DISK_HEADERS: [&str; 7] = ["Disk", "Mount", "Used", "Free", "Total", "R/s", "W/s"]; @@ -101,75 +99,6 @@ pub struct DisplayableData { pub cpu_data: Vec, } -/// Generates random colours. Strategy found from -/// https://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/ -fn gen_n_styles(num_to_gen: i32) -> Vec