]> git.cworth.org Git - acre/blobdiff - acre.c
Add some distinguishing colors for the datasets
[acre] / acre.c
diff --git a/acre.c b/acre.c
index e444e30557222e0ee73b7af7138a32a3f46213f9..12be71d249952421f0fb17caa956e3cd74377a0f 100644 (file)
--- a/acre.c
+++ b/acre.c
@@ -502,6 +502,16 @@ _draw_data (acre_t *acre)
     cairo_t *cr = acre->cr;
     unsigned int d, i;
     acre_data_t *data;
+#define NUM_COLORS 3
+    struct {
+       double r;
+       double g;
+       double b;
+    } colors [NUM_COLORS] = {
+       {1, 0, 0},
+       {0, 1, 0},
+       {0, 0, 1}
+    };
 
     cairo_save (cr);
 
@@ -510,6 +520,11 @@ _draw_data (acre_t *acre)
     _set_transform_to_data_space (acre);
 
     for (d = 0; d < acre->num_data; d++) {
+       int color = d % NUM_COLORS;
+       cairo_set_source_rgb (cr,
+                             colors[color].r,
+                             colors[color].g,
+                             colors[color].b);
        data = acre->data[d];
        cairo_new_path (cr);
        for (i = 0; i < data->num_points; i++) {