X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=acre.c;h=12be71d249952421f0fb17caa956e3cd74377a0f;hb=af6a6a5cafbbbbb1d5e1cffcab4c5903853d9758;hp=3ddf14382a880a7db7edebff34512040e34fb1e3;hpb=573652f264c7fc92e985d118b1f3dc64a5c6c9fc;p=acre diff --git a/acre.c b/acre.c index 3ddf143..12be71d 100644 --- a/acre.c +++ b/acre.c @@ -160,7 +160,7 @@ acre_add_data (acre_t *acre, acre_data_t *data) #define ACRE_FONT_FAMILY "sans" #define ACRE_FONT_SIZE 12 -#define ACRE_TITLE_FONT_SIZE 32 +#define ACRE_TITLE_FONT_SIZE 20 #define ACRE_PAD (ACRE_FONT_SIZE) #define ACRE_TICK_MAJOR_SIZE 6 #define ACRE_TICK_MINOR_SIZE 3 @@ -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++) {