netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=bb1f06e23a1020207b76f2014f5509becf7dfc86

commit bb1f06e23a1020207b76f2014f5509becf7dfc86
Author: Alastair Poole <nets...@gmail.com>
Date:   Mon Sep 7 16:20:12 2020 +0100

    colors: programmable for human.
---
 src/bin/ui/ui_cpu.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/bin/ui/ui_cpu.c b/src/bin/ui/ui_cpu.c
index b2469bc..8440293 100644
--- a/src/bin/ui/ui_cpu.c
+++ b/src/bin/ui/ui_cpu.c
@@ -3,6 +3,13 @@
 #define COLOR_FG 0xff2f99ff
 #define COLOR_BG 0xff202020
 
+
+#define COLOR_HIGH     0xff26f226
+#define COLOR_MID_HIGH 0xfff2f226
+#define COLOR_MID      0xffe21212
+#define COLOR_MID_LOW  0xff471292
+#define COLOR_LOW      0xff2f99ff
+
 typedef struct {
    Ui          *ui;
    int          cpu_id;
@@ -67,12 +74,12 @@ _color_rng(int fr, int fr_min, int fr_max)
    n = fr - fr_min;
    n = (n * 10) / rng;
 
-   if (n > 8) return 0xff26f226;
-   if (n > 6) return 0xfff2f226;
-   if (n > 4) return 0xffe21212;
-   if (n > 2) return 0xff471292;
+   if (n > 8) return COLOR_HIGH;
+   if (n > 6) return COLOR_MID_HIGH;
+   if (n > 4) return COLOR_MID;
+   if (n > 2) return COLOR_MID_LOW;
 
-   return COLOR_FG;
+   return COLOR_LOW;
 }
 
 static int

-- 


Reply via email to