4 function value (r, g, b) {
5 return max(r,max(g,b));
7 function putColor (n, r, g, b, v)
9 printf ("<td bgcolor=\"#%02x%02x%02x\" title=\"#%02x%02x%02x\">",r,g,b,r,g,b);
10 if (v < 0.51) printf ("<font color=\"white\">%s</font>", n);
11 else printf ("%s", n);
16 if (ARGV[1] == "--single-line") {
25 if (length(name) > 0) {
27 printf ("%s color scheme<BR>\n", name);
29 printf ("<table border=\"1\" align=\"center\" class=\"gv-colors\">\n");
32 if (singleRow) idx = NR;
33 else idx = NR % colorsPerRow;
34 if (idx == 1) printf ("<tr align=\"center\">\n");
35 putColor($1,$2,$3,$4,value($2/255.0,$3/255.0,$4/255.0));
36 if (idx == 0) printf ("</tr>\n");
39 if (idx != 0) printf ("</tr>\n");
40 printf ("</table><HR>\n");