]> granicus.if.org Git - graphviz/commitdiff
Add support for color namespaces; add Brewer color data
authorerg <devnull@localhost>
Mon, 21 Nov 2005 21:25:40 +0000 (21:25 +0000)
committererg <devnull@localhost>
Mon, 21 Nov 2005 21:25:40 +0000 (21:25 +0000)
awk/brewer.awk [new file with mode: 0644]
lib/common/Makefile.am
lib/common/Makefile.old

diff --git a/awk/brewer.awk b/awk/brewer.awk
new file mode 100644 (file)
index 0000000..116841e
--- /dev/null
@@ -0,0 +1,27 @@
+# 
+# /**********************************************************
+# *      This software is part of the graphviz package      *
+# *                http://www.graphviz.org/                 *
+# *                                                         *
+# *            Copyright (c) 1994-2005 AT&T Corp.           *
+# *                and is licensed under the                *
+# *            Common Public License, Version 1.0           *
+# *                      by AT&T Corp.                      *
+# *                                                         *
+# *        Information and Software Systems Research        *
+# *              AT&T Research, Florham Park NJ             *
+# **********************************************************/
+# 
+# Convert Brewer data to same RGB format used in color_names.
+# See brewer_colors for input format.
+#
+BEGIN { 
+  FS = ","
+}
+/^[^#]/{
+  if ($1 != "") {
+    name = $1 $2;
+    gsub ("\"","",name);
+  }
+  printf ("/%s/%s %s %s %s\n", name, $5, $7, $8, $9); 
+}
index b91b683b777905db9e278f2153997d2264738284..e3c9cf0960afea2a5128490d4fdc9cccce0c1d4a 100644 (file)
@@ -39,7 +39,10 @@ colortbl.h : color_lib
        $(AWK) -f $(top_srcdir)/awk/colortbl.awk color_lib > colortbl.h
 
 color_lib : $(top_srcdir)/lib/common/color_names
-       $(SED) s/_//g $(top_srcdir)/lib/common/color_names | LC_COLLATE=C $(SORT) > color_lib
+       cat brewer_lib $(top_srcdir)/lib/common/color_names | LC_COLLATE=C $(SORT) > color_lib
+
+brewer_lib : $(top_srcdir)/lib/common/brewer_colors
+       $(AWK) -f $(top_srcdir)/awk/brewer.awk $(top_srcdir)/lib/common/brewer_colors > brewer_lib
 
 htmllex.o htmllex.lo: htmllex.c htmllex.h htmlparse.h
 htmlparse.o htmlparse.lo: htmlparse.c htmlparse.h
@@ -53,7 +56,7 @@ htmlparse.c: y.output
 htmlparse.h: y.output
        @SED@ "s/yy/html/g" < y.tab.h > htmlparse.h
 
-DISTCLEANFILES = color_lib colortbl.h y.output y.tab.[ch] htmlparse.[ch]
+DISTCLEANFILES = brewer_lib color_lib colortbl.h y.output y.tab.[ch] htmlparse.[ch]
 
 EXTRA_DIST = Makefile.old README.imap chars.tcl ps.h \
        strcasecmp.c strncasecmp.c htmlparse.c htmlparse.h y.output
index 19af16884ddd798dad07dba7e40c4c7d76e3770c..3d5c5426a135c61e7d848e00fdc6fc7a110db9b2 100644 (file)
@@ -64,10 +64,11 @@ htmlparse.o htmllex.o : htmllex.h
 #ps.h : ps.txt
 #      $(AWK) -f $(AWKDIR)/stringize.awk ps.txt > ps.h
 
-colortbl.h : color_names
-       $(SED) s/_//g color_names | LC_COLLATE=C $(SORT) > color_lib
+colortbl.h : color_names brewer_colors
+       $(AWK) -f $(AWKDIR)/brewer.awk brewer_colors > brewer_lib
+       cat brewer_lib color_names | LC_COLLATE=C $(SORT) > color_lib
        $(AWK) -f $(AWKDIR)/colortbl.awk color_lib > colortbl.h
-       $(RM) color_lib
+       $(RM) color_lib brewer_lib
 
 clean:
        $(RM) core *.o htmlparse.c htmlparse.h colortbl.h y.output