[baobab] Update chart color palette



commit 871992d0105037e9d809315fb6cc6baa2bae969c
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Sat Jun 27 23:15:01 2020 +0200

    Update chart color palette
    
    Following https://developer.gnome.org/hig/stable/icon-design.html

 data/baobab.css       | 13 +++++++------
 src/baobab-chart.vala |  8 ++++----
 2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/data/baobab.css b/data/baobab.css
index c6e131b..d67d572 100644
--- a/data/baobab.css
+++ b/data/baobab.css
@@ -65,12 +65,13 @@ window infobar.error {
     border-bottom-color: @borders;
 }
 
-@define-color tango_color_0 #ef2929;
-@define-color tango_color_1 #ad7fa8;
-@define-color tango_color_2 #729fcf;
-@define-color tango_color_3 #8ae234;
-@define-color tango_color_4 #e9b96e;
-@define-color tango_color_5 #fcaf3e;
+@define-color color_0 #3584e4;
+@define-color color_1 #33d17a;
+@define-color color_2 #f6d32d;
+@define-color color_3 #ff7800;
+@define-color color_4 #e01b24;
+@define-color color_5 #9141ac;
+@define-color color_6 #986a44;
 
 @define-color level_color #d3d6d1;
 @define-color level_color_hi #e0e2dd;
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index 0275efe..54764df 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -55,7 +55,7 @@ namespace Baobab {
         protected const uint MIN_DEPTH = 1;
 
         // Keep in sync with colors defined in CSS
-        const int NUM_TANGO_COLORS = 6;
+        const int NUM_COLORS = 7;
 
         bool model_changed;
 
@@ -437,10 +437,10 @@ namespace Baobab {
                 Gdk.RGBA color_a, color_b;
 
                 int color_number = (int) (rel_position / (100.0/3));
-                int next_color_number = (color_number + 1) % NUM_TANGO_COLORS;
+                int next_color_number = (color_number + 1) % NUM_COLORS;
 
-                context.lookup_color ("tango_color_" + color_number.to_string (), out color_a);
-                context.lookup_color ("tango_color_" + next_color_number.to_string (), out color_b);
+                context.lookup_color ("color_" + color_number.to_string (), out color_a);
+                context.lookup_color ("color_" + next_color_number.to_string (), out color_b);
 
                 color = interpolate_colors (color_a, color_b, (rel_position - color_number * 100/3) / 
(100/3));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]