summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/metapost
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-07-27 23:15:42 +0000
committerKarl Berry <karl@freefriends.org>2011-07-27 23:15:42 +0000
commit62263d6664dd3ca8d42bcfc6445e2c189154745b (patch)
tree5d8c5f33a619380e316ca222a26e1807be042e57 /Master/texmf-dist/source/metapost
parenta5f505fa400aa240740da0daee3c527b2e63934c (diff)
new metapost package mpcolornames (27jul11)
git-svn-id: svn://tug.org/texlive/trunk@23252 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/metapost')
-rw-r--r--Master/texmf-dist/source/metapost/mpcolornames/Makefile76
-rw-r--r--Master/texmf-dist/source/metapost/mpcolornames/spec-dvipsnam-def.awk72
-rw-r--r--Master/texmf-dist/source/metapost/mpcolornames/spec-plain-mp.awk72
-rw-r--r--Master/texmf-dist/source/metapost/mpcolornames/spec-svgnam-def.awk70
-rw-r--r--Master/texmf-dist/source/metapost/mpcolornames/spec-x11nam-def.awk81
-rw-r--r--Master/texmf-dist/source/metapost/mpcolornames/spec-xcolor-sty.awk130
-rw-r--r--Master/texmf-dist/source/metapost/mpcolornames/tab-clash-svg-dvips.awk40
7 files changed, 541 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/metapost/mpcolornames/Makefile b/Master/texmf-dist/source/metapost/mpcolornames/Makefile
new file mode 100644
index 00000000000..e4464e71fca
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpcolornames/Makefile
@@ -0,0 +1,76 @@
+PDFLATEX = pdflatex
+MPOST = mpost
+MARKDOWN = markdown
+AWK = gawk
+CD = cd
+CP = cp
+RM = rm -f
+ZIP = zip
+PACKAGE=mpcolornames
+VERSION=v020
+
+
+.PHONY: all note clean doc todo release colorspecs
+
+
+note:
+ @echo "*** Makefile for $(PACKAGE) package ***"
+ @echo "Please type:"
+ @echo "make doc to build documentation."
+ @echo "make todo to build TODO list."
+ @echo "make clean to clean this directory."
+ @echo "make release to build a CTAN package."
+ @echo "make colorspecs to process .def files."
+
+
+all: doc
+
+
+doc: $(PACKAGE).pdf
+
+
+todo: TODO.html
+
+clean:
+ $(RM) *.aux *.bbl *.blg *.log *.out *.toc *.mps
+ $(RM) mpcolornames-spec-*.mp proof-spec-*.mp tab-spec-*.tex tab-clash-*.tex
+
+
+$(PACKAGE).pdf: colorspecs tab-clash
+ $(MPOST) expl-array-index
+ $(MPOST) fig-clash-svg-dvips
+ $(MPOST) proof-spec-dvipsnam-def
+ $(MPOST) proof-spec-svgnam-def
+ $(MPOST) proof-spec-x11nam-def
+ $(MPOST) proof-spec-xcolor-sty
+ $(MPOST) proof-spec-plain-mp
+ $(PDFLATEX) $(PACKAGE)
+ $(PDFLATEX) $(PACKAGE)
+ $(PDFLATEX) $(PACKAGE)
+
+
+TODO.html: TODO.mkd
+ $(MARKDOWN) $<
+
+
+colorspecs:
+ $(AWK) -f spec-svgnam-def.awk svgnam.def
+ $(AWK) -f spec-dvipsnam-def.awk dvipsnam.def
+ $(AWK) -f spec-x11nam-def.awk x11nam.def
+ $(AWK) -f spec-xcolor-sty.awk xcolor.sty
+ $(AWK) -f spec-plain-mp.awk plain.mp
+
+
+tab-clash:
+ $(AWK) -f tab-clash-svg-dvips.awk mpcolornames-spec-svgnam-def.mp mpcolornames-spec-dvipsnam-def.mp
+
+
+release: doc
+ $(RM) package/$(PACKAGE)-*.zip
+ $(RM) package/texmf/metapost/$(PACKAGE)/*
+ $(RM) package/texmf/doc/metapost/$(PACKAGE)/*
+ $(RM) package/texmf/source/metapost/$(PACKAGE)/*
+ $(CP) $(PACKAGE)*.mp package/texmf/metapost/$(PACKAGE)/
+ $(CP) $(PACKAGE).tex tab-*.tex expl-*.mp fig-*.mp CHANGES LICENSE README $(PACKAGE).pdf proof-*.mp package/texmf/doc/metapost/$(PACKAGE)/
+ $(CP) *.awk Makefile package/texmf/source/metapost/$(PACKAGE)/
+ $(CD) package && $(ZIP) -9r $(PACKAGE)-$(VERSION) texmf && $(CD) ..
diff --git a/Master/texmf-dist/source/metapost/mpcolornames/spec-dvipsnam-def.awk b/Master/texmf-dist/source/metapost/mpcolornames/spec-dvipsnam-def.awk
new file mode 100644
index 00000000000..5d57ac5c0db
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpcolornames/spec-dvipsnam-def.awk
@@ -0,0 +1,72 @@
+### file spec-dvipsnam-def.awk
+### Copyright 2009, 2011 Stephan Hennig
+#
+# This work may be distributed and/or modified under the conditions of
+# the LaTeX Project Public License, either version 1.3 of this license
+# or (at your option) any later version. The latest version of this
+# license is in http://www.latex-project.org/lppl.txt
+#
+BEGIN {
+ FS = "{|}|,"
+ i = 0
+}
+# file version
+/\[[0-9]+\/[0-9]+\/[0-9]+ v[0-9.]+[a-z]* .*\]/ {
+ match($0, "v[0-9.]+[a-z]*")
+ version = substr($0, RSTART, RLENGTH)
+}
+# CMYK color spec
+/^\\DefineNamedColor\{named\}\{[a-zA-Z]+\} *\{cmyk\}\{[0-9.]+,[0-9.]+,[0-9.]+,[0-9.]+\}/ {
+ i++
+ name[i] = $4
+ c[i] = $8
+ m[i] = $9
+ y[i] = $10
+ k[i] = $11
+# print name[i] "=(" c[i] "," m[i] "," y[i] "," k[i] ")"
+}
+END {
+ print "Found " i " DVIPS colors (" version ")."
+# Build file mpcolornames-spec-dvipsnam-def.mp.
+ file = "mpcolornames-spec-dvipsnam-def.mp"
+ print "%%% file " file > file
+ print "%%% Copyright 2009, 2011 Stephan Hennig" >> file
+ print "%" >> file
+ print "% This work may be distributed and/or modified under the conditions of" >> file
+ print "% the LaTeX Project Public License, either version 1.3 of this license" >> file
+ print "% or (at your option) any later version. The latest version of this" >> file
+ print "% license is in http://www.latex-project.org/lppl.txt" >> file
+ print "%" >> file
+ print "def _mpcolornames_spec_dvipsnam_def=" >> file
+ print "cmykcolor" >> file
+ for (j = 1; j < i; j++) print name[j] "," >> file
+ print name[i] ";" >> file
+ for (j = 1; j <= i; j++) print name[j] ":=(" c[j] "," m[j] "," y[j] "," k[j] ");" >> file
+ print "enddef;" >> file
+ print "endinput" >> file
+
+# Build file proof-spec-dvipsnam-def.mp.
+ file = "proof-spec-dvipsnam-def.mp"
+ print "%%% file " file > file
+ print "input proof-mpcolornames" >> file
+ print "dvipsnames;" >> file
+ print "defaultcolormodel := 7;% CMYK" >> file
+ print "specname := \"dvipsnam-def\";" >> file
+ for (j = 1; j <= i; j++) print "proof(" name[j] ");" >> file
+ print "end" >> file
+
+# Build file tab-spec-dvipsnam-def.tex.
+ file = "tab-spec-dvipsnam-def.tex"
+ print "%%% file " file > file
+ print "\\vspace{\\floatsep}" >> file
+ print "\\begin{multicols}{4}[\\noindent\\parbox{\\textwidth}{%" >> file
+ print " \\captionof{table}{CMYK colors from DVIPS specification.}%" >> file
+ print " \\label{tab:spec-dvipsnam-def}%" >> file
+ print " \\footnotesize Taken from file \\texttt{dvipsnam.def} " version " as distributed by \\LaTeX\\ package \\name{color} (" i " colors)." >> file
+ print " }]" >> file
+ print " \\raggedcolumns" >> file
+ print " \\setlength{\\parindent}{0pt}" >> file
+ print " \\ttfamily\\small\\color{mpcolor}" >> file
+ for (j = 1; j <= i; j++) print "\\colorproof[dvipsnam-def]{" name[j] "}\\par" >> file
+ print "\\end{multicols}" >> file
+}
diff --git a/Master/texmf-dist/source/metapost/mpcolornames/spec-plain-mp.awk b/Master/texmf-dist/source/metapost/mpcolornames/spec-plain-mp.awk
new file mode 100644
index 00000000000..ab9c64eb97d
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpcolornames/spec-plain-mp.awk
@@ -0,0 +1,72 @@
+### file spec-plain-mp.awk
+### Copyright 2009, 2011 Stephan Hennig
+#
+# This work may be distributed and/or modified under the conditions of
+# the LaTeX Project Public License, either version 1.3 of this license
+# or (at your option) any later version. The latest version of this
+# license is in http://www.latex-project.org/lppl.txt
+#
+BEGIN {
+ FS = " = |\\(|\\)|,"
+ i = 0
+}
+# file version
+/base_version=\"[0-9.]+[a-z]*\";/ {
+ match($0, "base_version=\"[0-9.]+[a-z]*\"")
+ version = substr($0, RSTART, RLENGTH)
+ match($0, "[0-9.]+[a-z]*")
+ version = substr($0, RSTART, RLENGTH)
+}
+# RGB color spec
+/^[a-z]+ = \([0-9.]+,[0-9.]+,[0-9.]+\);$/ {
+ i++
+ name[i] = $1
+ r[i] = $3
+ g[i] = $4
+ b[i] = $5
+# print name[i] "=(" r[i] "," g[i] "," b[i] ")"
+}
+END {
+ print "Found " i " plain.mp colors (" version ")."
+# Build file mpcolornames-spec-plain-mp.mp.
+ file = "mpcolornames-spec-plain-mp.mp"
+ print "%%% file " file > file
+ print "%%% Copyright 2009, 2011 Stephan Hennig" >> file
+ print "%" >> file
+ print "% This work may be distributed and/or modified under the conditions of" >> file
+ print "% the LaTeX Project Public License, either version 1.3 of this license" >> file
+ print "% or (at your option) any later version. The latest version of this" >> file
+ print "% license is in http://www.latex-project.org/lppl.txt" >> file
+ print "%" >> file
+ print "def _mpcolornames_spec_plain_mp=" >> file
+ print "rgbcolor" >> file
+ for (j = 1; j < i; j++) print name[j] "," >> file
+ print name[i] ";" >> file
+ for (j = 1; j <= i; j++) print name[j] ":=(" r[j] "," g[j] "," b[j] ");" >> file
+ print "enddef;" >> file
+ print "endinput" >> file
+
+# Build file proof-spec-plain-mp.mp.
+ file = "proof-spec-plain-mp.mp"
+ print "%%% file " file > file
+ print "input proof-mpcolornames" >> file
+ print "defaultcolormodel := 5;% RGB" >> file
+ print "specname := \"plain-mp\";" >> file
+ for (j = 1; j <= i; j++) print "proof(" name[j] ");" >> file
+ print "end" >> file
+
+# Build file tab-spec-plain-mp.tex.
+ file = "tab-spec-plain-mp.tex"
+ print "%%% file " file > file
+ print "\\vspace{\\floatsep}" >> file
+ print "\\begin{multicols}{5}[\\noindent\\parbox{\\textwidth}{%" >> file
+ print " \\captionof{table}{Default RGB colors in MetaPost.}%" >> file
+ print " \\label{tab:spec-plain-mp}%" >> file
+ print " \\footnotesize Taken from file \\texttt{plain.mp} " version " as distributed by MetaPost (" i " colors)." >> file
+ print " }]" >> file
+ print " \\raggedcolumns" >> file
+ print " \\setlength{\\parindent}{0pt}" >> file
+ print " \\ttfamily\\small\\color{mpcolor}" >> file
+ for (j = 1; j <= i; j++) print "\\colorproof[plain-mp]{" name[j] "}\\par" >> file
+ print "\\end{multicols}" >> file
+}
diff --git a/Master/texmf-dist/source/metapost/mpcolornames/spec-svgnam-def.awk b/Master/texmf-dist/source/metapost/mpcolornames/spec-svgnam-def.awk
new file mode 100644
index 00000000000..060be65b733
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpcolornames/spec-svgnam-def.awk
@@ -0,0 +1,70 @@
+### file spec-svgnam-def.awk
+### Copyright 2009, 2011 Stephan Hennig
+#
+# This work may be distributed and/or modified under the conditions of
+# the LaTeX Project Public License, either version 1.3 of this license
+# or (at your option) any later version. The latest version of this
+# license is in http://www.latex-project.org/lppl.txt
+#
+BEGIN {
+ FS = ",|;|}"
+ i = 0
+}
+# file version
+/\[[0-9]+\/[0-9]+\/[0-9]+ v[0-9.]+[a-z]* .*\]/ {
+ match($0, "v[0-9.]+[a-z]*")
+ version = substr($0, RSTART, RLENGTH)
+}
+# RGB color spec
+/[a-z]+,[0-9.]+,[0-9.]+,[0-9.]+[;}]/ {
+ i++
+ name[i] = $1
+ r[i] = $2
+ g[i] = $3
+ b[i] = $4
+# print name[i] "=(" r[i] "," g[i] "," b[i] ")"
+}
+END {
+ print "Found " i " SVG colors (" version ")."
+# Build file mpcolornames-spec-svgnam-def.mp.
+ file = "mpcolornames-spec-svgnam-def.mp"
+ print "%%% file " file > file
+ print "%%% Copyright 2009, 2011 Stephan Hennig" >> file
+ print "%" >> file
+ print "% This work may be distributed and/or modified under the conditions of" >> file
+ print "% the LaTeX Project Public License, either version 1.3 of this license" >> file
+ print "% or (at your option) any later version. The latest version of this" >> file
+ print "% license is in http://www.latex-project.org/lppl.txt" >> file
+ print "%" >> file
+ print "def _mpcolornames_spec_svgnam_def=" >> file
+ print "rgbcolor" >> file
+ for (j = 1; j < i; j++) print name[j] "," >> file
+ print name[i] ";" >> file
+ for (j = 1; j <= i; j++) print name[j] ":=(" r[j] "," g[j] "," b[j] ");" >> file
+ print "enddef;" >> file
+ print "endinput" >> file
+
+# Build file proof-spec-svgnam-def.mp.
+ file = "proof-spec-svgnam-def.mp"
+ print "%%% file " file > file
+ print "input proof-mpcolornames" >> file
+ print "defaultcolormodel := 5;% RGB" >> file
+ print "specname := \"svgnam-def\";" >> file
+ for (j = 1; j <= i; j++) print "proof(" name[j] ");" >> file
+ print "end" >> file
+
+# Build file tab-spec-svgnam-def.tex.
+ file = "tab-spec-svgnam-def.tex"
+ print "%%% file " file > file
+ print "\\vspace{\\floatsep}" >> file
+ print "\\begin{multicols}{4}[\\noindent\\parbox{\\textwidth}{%" >> file
+ print " \\captionof{table}{RGB colors from SVG specification.}%" >> file
+ print " \\label{tab:spec-svgnam-def}%" >> file
+ print " \\footnotesize Taken from file \\texttt{svgnam.def} " version " as distributed by \\LaTeX\\ package \\name{xcolor} (" i " colors)." >> file
+ print " }]" >> file
+ print " \\raggedcolumns" >> file
+ print " \\setlength{\\parindent}{0pt}" >> file
+ print " \\ttfamily\\small\\color{mpcolor}" >> file
+ for (j = 1; j <= i; j++) print "\\colorproof[svgnam-def]{" name[j] "}\\par" >> file
+ print "\\end{multicols}" >> file
+}
diff --git a/Master/texmf-dist/source/metapost/mpcolornames/spec-x11nam-def.awk b/Master/texmf-dist/source/metapost/mpcolornames/spec-x11nam-def.awk
new file mode 100644
index 00000000000..64e4e9c6b4e
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpcolornames/spec-x11nam-def.awk
@@ -0,0 +1,81 @@
+### file spec-x11nam-def.awk
+### Copyright 2009, 2011 Stephan Hennig
+#
+# This work may be distributed and/or modified under the conditions of
+# the LaTeX Project Public License, either version 1.3 of this license
+# or (at your option) any later version. The latest version of this
+# license is in http://www.latex-project.org/lppl.txt
+#
+BEGIN {
+ FS = ",|;|}"
+ i = 0
+ j = 0
+}
+# file version
+/\[[0-9]+\/[0-9]+\/[0-9]+ v[0-9.]+[a-z]* .*\]/ {
+ match($0, "v[0-9.]+[a-z]*")
+ version = substr($0, RSTART, RLENGTH)
+}
+# RGB color spec
+/^[a-zA-Z]+[0-9],[0-9.]+,[0-9.]+,[0-9.]+[;}]/ {
+ i++
+ name[i] = $1
+ r[i] = $2
+ g[i] = $3
+ b[i] = $4
+ basename = name[i]
+ sub(/[0-9]+$/, "", basename)
+ flag = 0
+ for (n = 1; n <= j; n++)
+ if (bname[n] == basename) flag = 1
+ if (flag == 0) {
+ j++
+ bname[j] = basename
+ }
+# print basename ":" name[i] "=(" r[i] "," g[i] "," b[i] ")"
+}
+END {
+ print "Found " i " X11 colors (" version ")."
+ print "Found " j " X11 color base names."
+# Build file mpcolornames-spec-x11nam-def.mp.
+ file = "mpcolornames-spec-x11nam-def.mp"
+ print "%%% file " file > file
+ print "%%% Copyright 2009, 2011 Stephan Hennig" >> file
+ print "%" >> file
+ print "% This work may be distributed and/or modified under the conditions of" >> file
+ print "% the LaTeX Project Public License, either version 1.3 of this license" >> file
+ print "% or (at your option) any later version. The latest version of this" >> file
+ print "% license is in http://www.latex-project.org/lppl.txt" >> file
+ print "%" >> file
+ print "def _mpcolornames_spec_xelevennam_def=" >> file
+ print "rgbcolor" >> file
+ for (n = 1; n < j; n++) print bname[n] "[]," >> file
+ print bname[j] "[];" >> file
+ for (n = 1; n <= i; n++) print name[n] ":=(" r[n] "," g[n] "," b[n] ");" >> file
+ print "enddef;" >> file
+ print "endinput" >> file
+
+# Build file proof-spec-x11nam-def.mp.
+ file = "proof-spec-x11nam-def.mp"
+ print "%%% file " file > file
+ print "input proof-mpcolornames" >> file
+ print "defaultcolormodel := 5;% RGB" >> file
+ print "specname := \"x11nam-def\";" >> file
+ for (n = 1; n <= i; n++) print "proof(" name[n] ");" >> file
+ print "end" >> file
+
+# Build file tab-spec-x11nam-def.tex.
+ file = "tab-spec-x11nam-def.tex"
+ print "%%% file " file > file
+ print "\\vspace{\\floatsep}" >> file
+ print "\\begin{multicols}{4}[\\noindent\\parbox{\\textwidth}{%" >> file
+ print " \\captionof{table}{RGB colors from X11 specification.}%" >> file
+ print " \\label{tab:spec-x11nam-def}%" >> file
+ print " \\footnotesize Taken from file \\texttt{x11nam.def} " version " as distributed by \\LaTeX\\ package \\name{xcolor} (" i " colors)." >> file
+ print " }]" >> file
+ print " \\raggedcolumns" >> file
+ print " \\setlength{\\parindent}{0pt}" >> file
+ print " \\ttfamily\\small\\color{mpcolor}" >> file
+ for (n = 1; n <= i; n++) print "\\colorproof[x11nam-def]{" name[n] "}\\par" >> file
+ print "\\end{multicols}" >> file
+}
diff --git a/Master/texmf-dist/source/metapost/mpcolornames/spec-xcolor-sty.awk b/Master/texmf-dist/source/metapost/mpcolornames/spec-xcolor-sty.awk
new file mode 100644
index 00000000000..fbf5e3db851
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpcolornames/spec-xcolor-sty.awk
@@ -0,0 +1,130 @@
+### file spec-xcolor-sty.awk
+### Copyright 2009, 2011 Stephan Hennig
+#
+# This work may be distributed and/or modified under the conditions of
+# the LaTeX Project Public License, either version 1.3 of this license
+# or (at your option) any later version. The latest version of this
+# license is in http://www.latex-project.org/lppl.txt
+#
+BEGIN {
+ FS = ",|;|}|{| |/"
+ i = 0
+}
+# file version
+/\[[0-9]+\/[0-9]+\/[0-9]+ v[0-9.]+[a-z]* .*\]/ {
+ match($0, "v[0-9.]+[a-z]*")
+ version = substr($0, RSTART, RLENGTH)
+}
+# rgb/hsb/cmyk/gray
+/[a-z]+,[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+,[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+[;}]/ {
+ i++
+ name[i] = $3
+ r[i] = $4
+ g[i] = $5
+ b[i] = $6
+ hu[i] = $7
+ sa[i] = $8
+ br[i] = $9
+ c[i] = $10
+ m[i] = $11
+ y[i] = $12
+ k[i] = $13
+ gry[i] = $14
+# print name[i] "=(" r[i] "," g[i] "," b[i] ")(" hu[i] "," sa[i] "," br[i] ")(" c[i] "," m[i] "," y[i] "," k[i] ")(" gry[i] ")"
+}
+# cmyk/rgb/hsb/gray
+/[a-z]+,[0-9.]+,[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+[;}]/ {
+ i++
+ name[i] = $3
+ c[i] = $4
+ m[i] = $5
+ y[i] = $6
+ k[i] = $7
+ r[i] = $8
+ g[i] = $9
+ b[i] = $10
+ hu[i] = $11
+ sa[i] = $12
+ br[i] = $13
+ gry[i] = $14
+# print name[i] "=(" c[i] "," m[i] "," y[i] "," k[i] ")(" r[i] "," g[i] "," b[i] ")(" hu[i] "," sa[i] "," br[i] ")(" gry[i] ")"
+}
+# gray/rgb/hsb/cmyk
+/[a-z]+,[0-9.]+\/[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+,[0-9.]+,[0-9.]+\/[0-9.]+,[0-9.]+,[0-9.]+,[0-9.]+[;}]/ {
+ i++
+ name[i] = $3
+ gry[i] = $4
+ r[i] = $5
+ g[i] = $6
+ b[i] = $7
+ hu[i] = $8
+ sa[i] = $9
+ br[i] = $10
+ c[i] = $11
+ m[i] = $12
+ y[i] = $13
+ k[i] = $14
+# print name[i] "=(" gry[i] ")(" r[i] "," g[i] "," b[i] ")(" hu[i] "," sa[i] "," br[i] ")(" c[i] "," m[i] "," y[i] "," k[i] ")"
+}
+END {
+ print "Found " i " base colors (" version ")."
+# Build file mpcolornames-spec-xcolor-sty.mp.
+ file = "mpcolornames-spec-xcolor-sty.mp"
+ print "%%% file " file > file
+ print "%%% Copyright 2009, 2011 Stephan Hennig" >> file
+ print "%" >> file
+ print "% This work may be distributed and/or modified under the conditions of" >> file
+ print "% the LaTeX Project Public License, either version 1.3 of this license" >> file
+ print "% or (at your option) any later version. The latest version of this" >> file
+ print "% license is in http://www.latex-project.org/lppl.txt" >> file
+ print "%" >> file
+ print "def _mpcolornames_spec_xcolor_sty=" >> file
+ print "rgbcolor" >> file
+ for (j = 1; j < i; j++) print "rgb_" name[j] "," >> file
+ print "rgb_" name[i] ";" >> file
+ print "cmykcolor" >> file
+ for (j = 1; j < i; j++) print "cmyk_" name[j] "," >> file
+ print "cmyk_" name[i] ";" >> file
+ print "numeric" >> file
+ for (j = 1; j < i; j++) print "grey_" name[j] "," >> file
+ print "grey_" name[i] ";" >> file
+ for (j = 1; j <= i; j++) print "rgb_" name[j] ":=(" r[j] "," g[j] "," b[j] ");" >> file
+ for (j = 1; j <= i; j++) print "cmyk_" name[j] ":=(" c[j] "," m[j] "," y[j] "," k[j] ");" >> file
+ for (j = 1; j <= i; j++) print "grey_" name[j] ":=" gry[j] ";" >> file
+ print "enddef;" >> file
+ print "endinput" >> file
+
+
+# Build file proof-spec-xcolor-sty.mp.
+ file = "proof-spec-xcolor-sty.mp"
+ print "%%% file " file > file
+ print "input proof-mpcolornames" >> file
+ print "specname := \"xcolor-sty\";" >> file
+ print "defaultcolormodel := 5;% RGB" >> file
+ for (j = 1; j <= i; j++) print "proof(rgb_" name[j] ");" >> file
+ print "defaultcolormodel := 7;% CMYK" >> file
+ for (j = 1; j <= i; j++) print "proof(cmyk_" name[j] ");" >> file
+ print "defaultcolormodel := 3;% grey scale" >> file
+ for (j = 1; j <= i; j++) print "proof(grey_" name[j] ");" >> file
+ print "end" >> file
+
+# Build file tab-spec-xcolor-sty.tex.
+ file = "tab-spec-xcolor-sty.tex"
+ print "%%% file " file > file
+# print "\\vspace{\\floatsep}" >> file
+ print "\\begingroup" >> file
+ print "\\ttfamily\\small\\color{mpcolor}" >> file
+ print "\\setlength{\\tabcolsep}{.5\\columnsep}" >> file
+ print "\\setlength{\\tabcolwidth}{\\textwidth}" >> file
+ print "\\addtolength{\\tabcolwidth}{-4\\tabcolsep}" >> file
+ print "\\setlength{\\tabcolwidth}{.333\\tabcolwidth}" >> file
+ print "\\begin{longtable}{@{}*{3}{p{\\tabcolwidth}}@{}}" >> file
+ print " \\caption{RGB, CMYK, and grey~scale colors from \\LaTeX\\ package \\name{xcolor}.}%" >> file
+ print " \\label{tab:spec-xcolor-sty}\\\\" >> file
+ print "\\multicolumn{3}{l}{\\normalfont\\footnotesize\\normalcolor Taken from file \\texttt{xcolor.sty} " version " as distributed by \\LaTeX\\ package \\name{xcolor} (" i " colors, with augmented names).}" >> file
+ print "\\endfirsthead" >> file
+ print "" >> file
+ for (j = 1; j <= i; j++) print "\\colorproof[xcolor-sty]{" name[j] "}\\\\" >> file
+ print "\\end{longtable}" >> file
+ print "\\endgroup" >> file
+}
diff --git a/Master/texmf-dist/source/metapost/mpcolornames/tab-clash-svg-dvips.awk b/Master/texmf-dist/source/metapost/mpcolornames/tab-clash-svg-dvips.awk
new file mode 100644
index 00000000000..0fd63a95f8a
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpcolornames/tab-clash-svg-dvips.awk
@@ -0,0 +1,40 @@
+### file tab-clash-svg-dvips.awk
+### Copyright 2009, 2011 Stephan Hennig
+#
+# This work may be distributed and/or modified under the conditions of
+# the LaTeX Project Public License, either version 1.3 of this license
+# or (at your option) any later version. The latest version of this
+# license is in http://www.latex-project.org/lppl.txt
+#
+BEGIN {
+ FS = ":=|(|)|,"
+}
+/^[^:]+:=[(]*[0-9.,]+[)]*);$/ {
+ name = $1
+ color[$1] = color[$1] + 1
+# print name
+}
+END {
+# Build file tab-clash-dvips-svg.tex.
+ file = "tab-clash-svg-dvips.tex"
+ print "%%% file " file > file
+ print "\\vspace{\\floatsep}" >> file
+ print "\\begin{multicols}{4}[\\noindent\\parbox{\\textwidth}{%" >> file
+ print " \\captionof{table}{Color names clashing in SVG (left) and DVIPS (right) specifications.}%" >> file
+ print " \\label{tab:clash-svg-dvips}%" >> file
+ print " }]" >> file
+ print " \\raggedcolumns" >> file
+ print " \\setlength{\\parindent}{0pt}" >> file
+ print " \\ttfamily\\small\\color{mpcolor}" >> file
+ ncolors = asorti(color, sortcolor)# requires gawk
+ n = 0
+ for (i = 1; i <= ncolors; i++) {
+ name = sortcolor[i]
+ if (color[name] > 1) {
+ n++
+ print "\\colorproof{" name "}\\par" >> file
+ }
+ }
+ print "\\end{multicols}" >> file
+ print "Found " n " color names clashing in SVG and DVIPS specs."
+}