From: erg Date: Mon, 21 Nov 2005 21:25:40 +0000 (+0000) Subject: Add support for color namespaces; add Brewer color data X-Git-Tag: LAST_LIBGRAPH~32^2~6952 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0269e0ddadf7b3b931fa2fdfb2be43835a722811;p=graphviz Add support for color namespaces; add Brewer color data --- diff --git a/awk/brewer.awk b/awk/brewer.awk new file mode 100644 index 000000000..116841eb8 --- /dev/null +++ b/awk/brewer.awk @@ -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); +} diff --git a/lib/common/Makefile.am b/lib/common/Makefile.am index b91b683b7..e3c9cf096 100644 --- a/lib/common/Makefile.am +++ b/lib/common/Makefile.am @@ -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 diff --git a/lib/common/Makefile.old b/lib/common/Makefile.old index 19af16884..3d5c5426a 100644 --- a/lib/common/Makefile.old +++ b/lib/common/Makefile.old @@ -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