From e4fa1f03e15aad376fcecfa8531306596c041cef Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 12 May 2005 11:32:39 +0000 Subject: [PATCH] allow 3/4 component color rrdtool graph --color too -- Alex git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@549 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index be557413..bb4c542e 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -3112,6 +3112,22 @@ rrd_graph_options(int argc, char *argv[],image_desc_t *im) int ci; int col_len = col_end - col_start; switch (col_len){ + case 3: + color = ( + ((color & 0xF00) * 0x110000) | + ((color & 0x0F0) * 0x011000) | + ((color & 0x00F) * 0x001100) | + 0x000000FF + ); + break; + case 4: + color = ( + ((color & 0xF000) * 0x11000) | + ((color & 0x0F00) * 0x01100) | + ((color & 0x00F0) * 0x00110) | + ((color & 0x000F) * 0x00011) + ); + break; case 6: color = (color << 8) + 0xff /* shift left by 8 */; break; -- 2.30.2