summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ee660f)
raw | patch | inline | side by side (parent: 8ee660f)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 10 Apr 2005 09:38:38 +0000 (09:38 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 10 Apr 2005 09:38:38 +0000 (09:38 +0000) |
program/src/rrd_graph.c | patch | blob | history |
index 66e6502448cdc3b52b231bda2f6ea588d3e6358d..4b9cb6c9a27a764bb08b950f273cca1a794dbaf1 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
{0,0,0,0}};
int option_index = 0;
int opt;
-
+ int col_start,col_end;
opt = getopt_long(argc, argv,
"s:e:x:y:v:w:h:iu:l:rb:oc:n:m:t:f:a:I:zgjFYAMX:S:NT:",
break;
case 'c':
if(sscanf(optarg,
- "%10[A-Z]#%8lx",
- col_nam,&color) == 2){
+ "%10[A-Z]#%n%8lx%n",
+ col_nam,&col_start,&color,&col_end) == 2){
int ci;
+ int col_len = col_end - col_start;
+ switch (col_len){
+ case 6:
+ color = (color << 8) + 0xff /* shift left by 8 */;
+ break;
+ case 8:
+ break;
+ default:
+ rrd_set_error("the color format is #RRGGBB[AA]");
+ return;
+ }
if((ci=grc_conv(col_nam)) != -1){
im->graph_col[ci]=color;
} else {
rrd_set_error("invalid color name '%s'",col_nam);
+ return;
}
} else {
rrd_set_error("invalid color def format");