texlive[48924] Master: pgf-cmykshadings (17oct18)

commits+karl at tug.org commits+karl at tug.org
Wed Oct 17 22:39:39 CEST 2018


Revision: 48924
          http://tug.org/svn/texlive?view=revision&revision=48924
Author:   karl
Date:     2018-10-17 22:39:38 +0200 (Wed, 17 Oct 2018)
Log Message:
-----------
pgf-cmykshadings (17oct18)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/
    trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/README.md
    trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/pgf-cmykshadings.pdf
    trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/
    trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.dtx
    trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.ins
    trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/
    trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgf-cmykshadings.sty
    trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-dvipdfmx.def
    trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-luatex.def
    trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-pdftex.def
    trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-xetex.def
    trunk/Master/tlpkg/tlpsrc/pgf-cmykshadings.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/README.md	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,107 @@
+# pgf-cmykshadings — Support for CMYK and grayscale shadings in PGF/TikZ
+
+The `pgf-cmykshadings` package provides support for CMYK and grayscale shadings
+for the `pgf` package. By default `pgf` only supports RGB shadings. Horizontal,
+vertical, radial, and functional shadings are supported for pdfLaTeX, LuaLaTeX,
+and XeLaTeX. `pgf-cmykshadings` attempts to produce shadings consistent with
+the currently selected `xcolor` colour model. The `rgb`, `cmyk`, and `gray`
+colour models from the `xcolor` package are supported.
+
+## Installation from TeXLive or MiKTeX
+
+`pgf-cmykshadings` is in TeXLive and MiKTeX and can be installed in the usual
+way through your distribution. e.g., in TeXLive by running:
+
+```
+tlmgr install pgf-cmykshadings
+```
+
+## Installation from CTAN
+
+Download and unpack `pgf-cmykshadings.zip` from CTAN at
+https://ctan.org/pkg/pgf-cmykshadings
+
+Change to the `pgf-cmykshadings` directory, then run:
+
+```
+tex pgf-cmykshadings.ins
+```
+
+to generate `pgf-cmykshadigns.sty`, `pgfsys-cmykshadings-pdftex.def`,
+`pgfsys-cmykshadings-xetex.def`, `pgfsys-cmykshadings-luatex.def`, and
+`pgfsys-cmykshadings-dvipdfmx.def`.
+
+Copy these generated files to `$TEXMFHOME/tex/latex/pgf-cmykshadings/` and
+`pgf-cmykshadings.pdf` to `$TEXMFHOME/doc/latex/pgf-cmykshadings/`.
+
+You can find `$TEXMFHOME` by running:
+
+```
+kpsewhich -var-value=TEXMFHOME
+```
+
+## Installation from Git Source
+
+`pgf-cmykshadings` uses the `l3build` system.
+
+Clone the git repository using:
+
+```
+git clone https://github.com/dcpurton/pgf-cmykshadings.git
+```
+
+Change to the `pgf-cmykshadings` directory, and then the package can be
+installed by running:
+
+```
+l3build install
+```
+
+Documentation (`pgf-cmykshadings.pdf`) can be compiled by running:
+
+```
+l3build doc
+```
+
+To install the documentation, copy `pgf-cmykshadings.pdf` to
+`$TEXMFHOME/doc/latex/pgf-cmykshadings/`.
+
+You can find `$TEXMFHOME` by running:
+
+```
+kpsewhich -var-value=TEXMFHOME
+```
+
+## Licence
+
+```
+Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+
+This work may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3c 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
+and version 1.3c or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work is "maintained" (as per the LPPL maintenance status)
+by David Purton.
+
+This work consists of the files pgf-cmykshadings.ins,
+pgf-cmykshadings.dtx, README.md, and the derived files
+  - pgf-cmykshadings.sty
+  - pgfsys-cmykshadings-pdftex.def
+  - pgfsys-cmykshadgins-xetex.def
+  - pgfsys-cmykshadings-luatex.def
+  - pgfsys-cmykshadings-dvipdfmx.def
+  - pgf-cmykshadings.pdf
+
+
+Substantial parts of the code for this package are taken from the pgf
+package files pgfcoreshade.code.tex, pgfsys-pdftex.def,
+pgfsys-luatex.def, and pgfsys-dvipdfmx.def copyright (c) 2006 Till
+Tantau and then slightly modified to support CMYK and grayscale
+shadings.
+```
+


Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/pgf-cmykshadings.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/pgf-cmykshadings.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/pgf-cmykshadings.pdf	2018-10-17 00:23:04 UTC (rev 48923)
+++ trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/pgf-cmykshadings.pdf	2018-10-17 20:39:38 UTC (rev 48924)

Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-cmykshadings/pgf-cmykshadings.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.dtx	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,1582 @@
+% \iffalse meta-comment
+%
+%Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+%
+%This work may be distributed and/or modified under the conditions of
+%the LaTeX Project Public License, either version 1.3c 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
+%and version 1.3c or later is part of all distributions of LaTeX
+%version 2005/12/01 or later.
+%
+%<*driver>
+\documentclass[a4paper]{l3doc}
+\usepackage{microtype}
+\usepackage{metalogo}
+\usepackage{pgf-cmykshadings}
+\usepackage{tikz}
+\usepackage{listings}
+\lstset{frame=single,basicstyle=\footnotesize\ttfamily}
+\begin{document}
+\DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{v1.0}{2018/10/17}{First public release}
+%
+% \title{The \pkg{pgf-cmykshadings} package}
+% \author{David Purton\thanks{Email: \url{dcpurton at marshwiggle.net}}}
+% \date{2018/10/17 v1.0}
+%
+% \maketitle
+%
+% \begin{abstract}
+%   The \pkg{pgf-cmykshadings} package provides support for CMYK and grayscale
+%   shadings for the \pkg{pgf} package. By default \pkg{pgf} only supports RGB
+%   shadings. Horizontal, vertical, radial, and functional shadings are
+%   supported for pdf\LaTeX, \LuaLaTeX, and \XeLaTeX. \pkg{pgf-cmykshadings}
+%   attempts to produce shadings consistent with the currently selected
+%   \pkg{xcolor} colour model. The |rgb|, |cmyk|, and |gray| colour models
+%   from the \pkg{xcolor} package are supported.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \begin{documentation}
+%
+% \section{Introduction}
+%
+% The \pkg{pgf} package, and other packages built on top of it, only support RGB
+% shadings (colour gradients). This means that printing applications requiring
+% CMYK shadings can not easily be produced. It also can lead to unexpected
+% colour mismatches in documents when attempting to define a shading from
+% colours defined in CMYK. This can occur when the |natural| colour model of the
+% \pkg{xcolor} package is in use and colours like cyan and magenta are defined
+% as CMYK. An attempt to produce a shading using these colours will be
+% silently converted to RGB, but RGB cyan and RGB magenta look significantly
+% different from CMYK cyan and magenta. This is a significant cause of
+% confusion for end users.
+%
+% The following example illustrates this problem and the corresponding solution
+% provided by the \pkg{pgf-cmykshadings} package.
+%
+% \begin{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\begin{tikzpicture}
+  \fill[cyan] (0,0) rectangle (1,1);
+  \shade[left color=cyan, right color=magenta]
+    (1.25,0) rectangle (3.75,1);
+  \fill[magenta] (4,0) rectangle (5,1);
+\end{tikzpicture}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+%   \begin{minipage}{0.45\linewidth}
+%   \pkg{pgf} behaviour:\medskip
+%
+%   \pgfcmykshadingdefaultfalse
+%   \begin{tikzpicture}
+%     \fill[cyan] (0,0) rectangle (1,1);
+%     \shade[left color=cyan, right color=magenta]
+%       (1.25,0) rectangle (3.75,1);
+%     \fill[magenta] (4,0) rectangle (5,1);
+%   \end{tikzpicture}
+%   \end{minipage}\hfill
+%   \begin{minipage}{0.45\linewidth}
+%   \pkg{pgf-cmykshadings} behaviour:\medskip
+%
+%   \pgfcmykshadingdefaulttrue
+%   \begin{tikzpicture}
+%     \fill[cyan] (0,0) rectangle (1,1);
+%     \shade[left color=cyan, right color=magenta]
+%       (1.25,0) rectangle (3.75,1);
+%     \fill[magenta] (4,0) rectangle (5,1);
+%   \end{tikzpicture}
+%   \end{minipage}
+% \end{quote}
+%
+% \section{Acknowledgements}
+%
+% Substantial parts of the code for the \pkg{pgf-cmykshadings} package are
+% taken from the \pkg{pgf} package files |pgfcoreshade.code.tex|,
+% |pgfsys-pdftex.def|, |pgfsys-dvipdfmx.def|, and |pgfsys-luatex.def| copyright
+% © 2006 Till Tantau and then slightly modified to support CMYK and grayscale
+% shadings.
+%
+% \section{Bug Reports and Feature Requests}
+%
+% Bug reports and feature requests can be made at the \pkg{pgf-cmykshadings}
+% package GitHub respoitory. See
+% \url{https://github.com/dcpurton/pgf-cmykshadings}.
+%
+% \section{Documentation}
+%
+% \subsection{Basic Usage}
+%
+% All that is required to use CMYK shadings instead of RGB shadings is to
+% include the package in your document preamble:
+% \begin{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\usepackage{pgf-cmykshadings}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+% \end{quote}
+% However, there are some caveats in using the package, which are outlined
+% below.
+%
+% \subsubsection{Package options}
+%
+% \pkg{pgd-cmykshadings} supports the following package options:
+%
+% \begin{description}
+%   \item[\mdseries |cmyk|] (default) to use CMYK shadings when the \pkg{xcolor}
+%     package |natural| colour model is in use.
+%   \item[\mdseries |rgb|] to use the RGB shadings when the \pkg{xcolor} package
+%     |natural| colour model is in use.
+% \end{description}
+%
+% \subsubsection{Load order}
+%
+% \pkg{pgf-cmykshadings} should be loaded \emph{before} any shadings are defined
+% otherwise these will be defined as RGB. This means you should load
+% \pkg{pgf-cmykshadings} before (for example) \pkg{tikz} and \pkg{beamer}.
+%
+% If you want to pass custom options to \pkg{xcolor} (e.g., a colour model or
+% set of named colours), you should load \pkg{pgf-cmykshadings} \emph{after}
+% \pkg{xcolor} or use \cs{PassOptionsToPackage} \emph{before} loading
+% \pkg{pgf-cmykshadings}.
+%
+% \subsubsection{Colour models}
+%
+% \pkg{pgf-cmykshadings} attempts to produce shadings consistent with the
+% currently selected \pkg{xcolor} package colour model. The |rgb|, |cmyk|, and
+% |gray| colour models from the \pkg{xcolor} package are supported.
+%
+% \textbf{Note:} The colour model chosen for a shading is based on the
+% \pkg{xcolor} colour model \emph{at the time the shading is created}. This is
+% either when \cs{pgfdeclare*shading} is called with no optional argument or
+% when \cs{pgfuseshading} is called if \cs{pgfdeclare*shading} was called with
+% an optional argument.
+%
+% If the \pkg{xcolor} package |natural| colour model is in use then the shading
+% colour model will be CMYK by default (equivalent to passing the |cmyk| option
+% to the \pkg{pgf-cmykshadings} package). RGB shadings can be output by default
+% instead by passing the |rgb| option to the \pkg{pgf-cmykshadings} package.
+%
+% In practice this means that if you are using the |natural| colour model of the
+% \pkg{xcolor} package you can still get mismatched colours if you, for example,
+% create a shading from green (which is defined as RGB) to magenta (which is
+% defined as CMYK). The shading has to pick one colour model and will look
+% different to one of the solid colours.
+%
+% For this reason it is recommended to always load the \pkg{xcolor} package
+% before the \pkg{pgf-cmykshadings} package with either the |rgb|, |cmyk|, or
+% |gray| options to avoid colour surprises.
+%
+% \begin{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\begin{tikzpicture}
+  \fill[green] (0,0) rectangle (1,1);
+  \shade[left color=green, right color=magenta]
+    (1.25,0) rectangle (3.75,1);
+  \fill[magenta] (4,0) rectangle (5,1);
+\end{tikzpicture}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+%   \begin{minipage}{0.45\linewidth}
+%   \pkg{xcolor} |natural| colour model:\medskip
+%
+%   \begin{tikzpicture}
+%     \fill[green] (0,0) rectangle (1,1);
+%     \shade[left color=green, right color=magenta]
+%       (1.25,0) rectangle (3.75,1);
+%     \fill[magenta] (4,0) rectangle (5,1);
+%   \end{tikzpicture}
+%   \end{minipage}\hfill
+%   \begin{minipage}{0.45\linewidth}
+%   \pkg{xcolor} |cmyk| colour model:\medskip
+%
+%   \selectcolormodel{cmyk}
+%   \begin{tikzpicture}
+%     \fill[green] (0,0) rectangle (1,1);
+%     \shade[left color=green, right color=magenta]
+%       (1.25,0) rectangle (3.75,1);
+%     \fill[magenta] (4,0) rectangle (5,1);
+%   \end{tikzpicture}
+%   \end{minipage}\medskip
+%
+%   \begin{minipage}{0.45\linewidth}
+%   \pkg{xcolor} |rgb| colour model:\medskip
+%
+%   \selectcolormodel{rgb}
+%   \begin{tikzpicture}
+%     \fill[green] (0,0) rectangle (1,1);
+%     \shade[left color=green, right color=magenta]
+%       (1.25,0) rectangle (3.75,1);
+%     \fill[magenta] (4,0) rectangle (5,1);
+%   \end{tikzpicture}
+%   \end{minipage}\hfill
+%   \begin{minipage}{0.45\linewidth}
+%   \pkg{xcolor} |gray| colour model:\medskip
+%
+%   \selectcolormodel{gray}
+%   \begin{tikzpicture}
+%     \fill[green] (0,0) rectangle (1,1);
+%     \shade[left color=green, right color=magenta]
+%       (1.25,0) rectangle (3.75,1);
+%     \fill[magenta] (4,0) rectangle (5,1);
+%   \end{tikzpicture}
+%   \end{minipage}
+% \end{quote}
+%
+% \subsubsection{Functional shadings}
+%
+% By nature, the PostScript® code used to generate functional shadings must
+% output either RGB or CMYK data. For this reason,
+% \cs{pgfdeclarefunctionalshading} is \emph{not} portable across colour models.
+%
+% Take particular care that the same colour model is in use at declaration time
+% and use time for functional shadings declared with an optional argument as
+% otherwise the PostScript® data will not match the declared colour space and
+% you will end up with a malformed PDF.
+%
+% This also means that you should \emph{not} use the functional shadings from
+% the \pkg{tikz} shading library (|bilinear interpolation|, |color wheel|,
+% |color wheel black center|, |color wheel white center|, and |Mandelbrot set|)
+% except when the \pkg{xcolor} |rgb| colour model is in use, otherwise you will
+% end up with a malformed PDF.
+%
+% Having said this, it \emph{is} possible to create portable functional shadings
+% by providing conditional code to append colour transformations to the
+% PostScript® data. A variety of \cs{pgffuncshading*to*} (e.g.,
+% \cs{pgffuncshadingrgbtocmyk}) macros along with \cs{ifpgfshadingmodel*} (e.g.,
+% \cs{ifpgfshadingmodelcmyk}) conditionals are provided to assist with these
+% transformations.
+%
+% \begin{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{lstlisting}
+\pgfdeclarefunctionalshading[black]{twospots}
+    {\pgfpointorigin}{\pgfpoint{3.5cm}{3.5cm}}{}{
+  2 copy
+  45 sub dup mul exch
+  40 sub dup mul 0.5 mul add sqrt
+  dup mul neg 1.0005 exch exp 1.0 exch sub
+  3 1 roll
+  70 sub dup mul .5 mul exch
+  70 sub dup mul add sqrt
+  dup mul neg 1.002 exch exp 1.0 exch sub
+  1.0 3 1 roll
+  \ifpgfshadingmodelcmyk
+    \pgffuncshadingrgbtocmyk
+  \fi
+  \ifpgfshadingmodelgray
+    \pgffuncshadingrgbtogray
+  \fi
+}
+\end{lstlisting}
+% \iffalse
+%</example>
+% \fi
+%
+% \pgfdeclarefunctionalshading[black]{twospots}
+%     {\pgfpointorigin}{\pgfpoint{3.5cm}{3.5cm}}{}{
+%   2 copy
+%   45 sub dup mul exch
+%   40 sub dup mul 0.5 mul add sqrt
+%   dup mul neg 1.0005 exch exp 1.0 exch sub
+%   3 1 roll
+%   70 sub dup mul .5 mul exch
+%   70 sub dup mul add sqrt
+%   dup mul neg 1.002 exch exp 1.0 exch sub
+%   1.0 3 1 roll
+%   \ifpgfshadingmodelcmyk
+%     \pgffuncshadingrgbtocmyk
+%   \fi
+%   \ifpgfshadingmodelgray
+%     \pgffuncshadingrgbtogray
+%   \fi
+% }
+%
+% \begin{minipage}{0.3\linewidth}
+%   \pkg{xcolor} |cmyk| model:\medskip
+%
+%   \selectcolormodel{cmyk}
+%   \pgfuseshading{twospots}
+% \end{minipage}\hfill
+% \begin{minipage}{0.3\linewidth}
+%   \pkg{xcolor} |rgb| model:\medskip
+%
+%   \selectcolormodel{rgb}
+%   \pgfuseshading{twospots}
+% \end{minipage}\hfill
+% \begin{minipage}{0.3\linewidth}
+%   \pkg{xcolor} |gray| model:\medskip
+%
+%   \selectcolormodel{gray}
+%   \pgfuseshading{twospots}
+% \end{minipage}
+% \end{quote}
+%
+%
+% \subsection{Main Interface}
+%
+% \subsubsection{Declaring shadings}
+%
+% The four standard \pkg{pgf} functions for declaring shadings are supported
+% as documented in the \pkg{pgf} manual.
+%
+% There is one extension provided by the \pkg{pgf-cmykshadings} package. It is
+% possible to specify CMYK colours directly in the colour specification
+% argument using a syntax analogous to the RGB, Gray, and named colours
+% already supported by the \pkg{pgf} package. i.e.,
+% |cmyk(|\meta{position}|)=(|\meta{C}|,|\meta{M}|,|\meta{Y}|,|\meta{K}|)|.
+%
+% Shadings declared \emph{without} an optional argument are created
+% immediately in the currently active \pkg{xcolor} colour model. Shadings
+% declared \emph{with} and optional argument are created at the time they are
+% actually used (using \cs{pgfuseshading}).
+%
+% \begin{function}{\pgfdeclarehorizontalshading}
+%   \begin{syntax}
+%     \cs{pgfdeclarehorizontalshading}\oarg{color list}\marg{shading name}\marg{shading height}\marg{color specification}
+%   \end{syntax}
+%   Declare a horizontal shading.
+% \end{function}
+%
+% \begin{function}{\pgfdeclareverticalshading}
+%   \begin{syntax}
+%     \cs{pgfdeclareverticalshading}\oarg{color list}\marg{shading name}\marg{shading width}\marg{color specification}
+%   \end{syntax}
+%   Declare a vertical shading.
+% \end{function}
+%
+% \begin{function}{\pgfdeclareradialshading}
+%   \begin{syntax}
+%     \cs{pgfdeclareradialshading}\oarg{color list}\marg{shading name}\marg{center point}\marg{color specification}
+%   \end{syntax}
+%   Declare a radial shading.
+% \end{function}
+%
+% \begin{function}{\pgfdeclarefunctionalshading}
+%   \begin{syntax}
+%     \cs{pgfdeclarefunctionalshading}\oarg{color list}\marg{shading name}\marg{lower left corner}\marg{upper right corner}\marg{init code}\marg{type 4 function}
+%   \end{syntax}
+%   Declare a functional shading.
+% \end{function}
+%
+% \subsubsection{Using shadings}
+%
+% Shadings are used as documented in the \pkg{pgf} manual.
+%
+% \begin{function}{\pgfuseshading}
+%   \begin{syntax}
+%     \cs{pgfuseshading}\marg{shading name}
+%   \end{syntax}
+%   Use a previously declared shading. If the specified shading was declared
+%   with an optional argument, then the shading will be created at this point
+%   in the currently active \pkg{xcolor} colour space.
+% \end{function}
+%
+% \begin{function}{\pgfshadepath}
+%   \begin{syntax}
+%     \cs{pgfshadepath}\marg{shading name}\marg{angle}
+%   \end{syntax}
+%   Shade the currently active \pkg{pgf} path using the specified shading at
+%   the specified angle.
+% \end{function}
+%
+% \begin{function}{\pgfadditionalshadetransform}
+%   \begin{syntax}
+%     \cs{pgfadditionalshadetransform}\marg{transformation}
+%   \end{syntax}
+%   This command is used to specify an additional transformation that should
+%   be applied to shadings when \cs{pgfshadepath} used.
+% \end{function}
+%
+% \subsubsection{Utility functions}
+%
+% The following functions are mainly useful for in declaring functional
+% shadings.
+%
+% \begin{function}{\pgfshadecolortorgb}
+%   \begin{syntax}
+%     \cs{pgfshadecolortorgb}\marg{color name}\marg{macro}
+%   \end{syntax}
+%   This command takes \meta{color name} as input and stores the colour's
+%   red/green/blue components as real numbers between 0.0 and 1.0 separated by
+%   spaces (which is exactly what you need if you want to push it on a stack)
+%   in \meta{macro}. This macro can then be used inside the \meta{type 4
+%   function} argument for \cs{pgfdeclarefunctionalshading}.
+%
+%   In addition, three macros suffixed with |red|, |green| and |blue| are
+%   defined, which store the individual components of \meta{color name}. These
+%   can also be used in the \meta{type 4 function} argument.
+% \end{function}
+%
+% \begin{function}{\pgfshadecolortocmyk}
+%   \begin{syntax}
+%     \cs{pgfshadecolortocmyk}\marg{color name}\marg{macro}
+%   \end{syntax}
+%   This command is analogous to \cs{pgfshadecolortorgb}, but stores the
+%   colour's cyan/magenta/yellow/black components. Four macros suffixed with
+%   |cyan|, |magenta|, |yellow|, and |black| are also defined.
+% \end{function}
+%
+% \begin{function}{\pgfshadecolortogray}
+%   \begin{syntax}
+%     \cs{pgfshadecolortogray}\marg{color name}\marg{macro}
+%   \end{syntax}
+%   This command is analogous to \cs{pgfshadecolortorgb}, but stores the
+%   colour's gray component. Although it's not needed, for consistency a
+%   second macro suffixed with |gray| is also defined.
+% \end{function}
+%
+% \begin{function}{\pgffuncshadingrgbtocmyk}
+%   \begin{syntax}
+%     \cs{pgffuncshadingrgbtocmyk}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to convert the
+%   top 3 elements on the stack from RGB to CMYK. In combination with the
+%   \cs{ifpgfshadingmodelcmyk} conditional this macro can be used to make
+%   functional shading declarations more portable across colour models.
+% \end{function}
+%
+% \begin{function}{\pgffuncshadingrgbtogray}
+%   \begin{syntax}
+%     \cs{pgffuncshadingrgbtogray}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to convert the
+%   top 3 elements on the stack from RGB to grayscale. In combination with the
+%   \cs{ifpgfshadingmodelgray} conditional this macro can be used to make
+%   functional shading declarations more portable across colour models.
+% \end{function}
+%
+% \begin{function}{\pgffuncshadingcmyktorgb}
+%   \begin{syntax}
+%     \cs{pgffuncshadingcmyktorgb}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to convert the
+%   top 4 elements on the stack from CMYK to RGB. In combination with the
+%   \cs{ifpgfshadingmodelrgb} conditional this macro can be used to make
+%   functional shading declarations more portable across colour models.
+% \end{function}
+%
+% \begin{function}{\pgffuncshadingcmyktogray}
+%   \begin{syntax}
+%     \cs{pgffuncshadingcmyktogray}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to convert the
+%   top 4 elements on the stack from CMYK to grayscale. In combination with
+%   the \cs{ifpgfshadingmodelgray} conditional this macro can be used to make
+%   functional shading declarations more portable across colour models.
+% \end{function}
+%
+% \begin{function}{\pgffuncshadinggraytorgb}
+%   \begin{syntax}
+%     \cs{pgffuncshadinggraytorgb}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to convert the
+%   top element on the stack from grayscale to RGB. In combination with the
+%   \cs{ifpgfshadingmodelrgb} conditional this macro can be used to make
+%   functional shading declarations more portable across colour models.
+% \end{function}
+%
+% \begin{function}{\pgffuncshadinggraytocmyk}
+%   \begin{syntax}
+%     \cs{pgffuncshadinggraytocmyk}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to convert the
+%   top element on the stack from grayscale to CMYK. In combination with the
+%   \cs{ifpgfshadingmodelcmyk} conditional this macro can be used to make
+%   functional shading declarations more portable across colour models.
+% \end{function}
+%
+% \begin{function}{\ifpgfshadingmodelrgb}
+%   \begin{syntax}
+%     \cs{ifpgfshadingmodelrgb}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to test if the
+%   \pkg{xcolor} colour model is |rgb| \emph{at the time the shading is
+%   created}. This can be used to ensure that the data output in the
+%   \meta{type 4 function} correctly matches the active colour model.
+% \end{function}
+%
+% \begin{function}{\ifpgfshadingmodelcmyk}
+%   \begin{syntax}
+%     \cs{ifpgfshadingmodelcmyk}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to test if the
+%   \pkg{xcolor} colour model is |cmyk| \emph{at the time the shading is
+%   created}. This can be used to ensure that the data output in the
+%   \meta{type 4 function} correctly matches the active colour model.
+% \end{function}
+%
+% \begin{function}{\ifpgfshadingmodelgray}
+%   \begin{syntax}
+%     \cs{ifpgfshadingmodelgray}
+%   \end{syntax}
+%   Within the \meta{type 4 function} argument of
+%   \cs{pgfdeclarefunctionalshading}, this command can be used to test if the
+%   \pkg{xcolor} colour model is |gray| \emph{at the time the shading is
+%   created}. This can be used to ensure that the data output in the
+%   \meta{type 4 function} correctly matches the active colour model.
+% \end{function}
+%
+% \end{documentation}
+%
+% \begin{implementation}
+%
+% \section{Implementation}
+%
+% \subsection{Main Package}
+%
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\ProvidesPackage{pgf-cmykshadings}%
+  [2018/10/17 CMYK shadings support for PGF (DCP)]
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\RequirePackage{pgf}
+%    \end{macrocode}
+%
+% \noindent Replace dependence on \cs{pgf at convertrgbstring} and
+% \cs{pgf at rgbconv} with generic macros \cs{pgf at convertstring} and
+% \cs{pgf at conv}.
+%
+%    \begin{macrocode}
+\def\pgf at parsefunc#1{%
+  \edef\temp{{#1}}%
+  \expandafter\pgf at convertstring\temp%
+  \edef\temp{{\pgf at conv}}%
+  \expandafter\pgf@@parsefunc\temp}
+%    \end{macrocode}
+%
+% \noindent Replace RGB parsing macros with new macros selected on the basis
+% of the current colour space (\cs{pgf at shading@mode}).
+%
+%    \begin{macrocode}
+\def\pgf@@parsefunc#1{%
+  \let\pgf at bounds=\pgfutil at empty%
+  \let\pgf at funcs=\pgfutil at empty%
+  \let\pgf at psfuncs=\pgfutil at empty%
+  \let\pgf at encode=\pgfutil at empty%
+  \let\pgf at sys@shading at ranges=\pgfutil at empty%
+  \pgf at sys@shading at range@num=0\relax%
+  \csname pgf at parsefirst\pgf at shading@model\endcsname[#1; ]%
+  \csname pgf at parselastdom\pgf at shading@model\endcsname[#1; ]%
+  \csname pgf at parsemid\pgf at shading@model\endcsname[#1; ]%
+  \ifx\pgf at bounds\pgfutil at empty%
+    \edef\pgf at pdfparseddomain{0 1}%
+    \edef\pgf at pdfparsedfunction{\pgf at singlefunc\space}%
+  \else%
+    \edef\pgf at pdfparseddomain{\pgf at doma\space\pgf at domb}%
+    \edef\pgf at pdfparsedfunction{%
+      << /FunctionType 3 /Domain [\pgf at doma\space\pgf at domb] /Functions
+      [\pgf at funcs\space] /Bounds [\pgf at bounds] /Encode [0 1 \pgf at encode]
+      >> }% <<
+  \fi%
+  \xdef\pgf at psfuncs{\pgf at psfuncs}%
+  }
+%    \end{macrocode}
+%
+% \noindent Define RGB parsing macros.
+%
+%    \begin{macrocode}
+\let\pgf at parsefirstrgb\pgf at parsefirst
+\let\pgf at parselastdomrgb\pgf at parselastdom
+\let\pgf at parsemidrgb\pgf at parsemid
+\let\pgf at parserestrgb\pgf at parserest
+%    \end{macrocode}
+%
+% \noindent Define new CMYK parsing macros.
+%
+%    \begin{macrocode}
+\def\pgf at parsefirstcmyk[cmyk(#1)=(#2,#3,#4,#5)#6]{%
+  \pgfmathsetlength\pgf at x{#1}%
+  \edef\pgf at sys@shading at start@pos{\the\pgf at x}%
+  \pgf at sys@bp at correct\pgf at x%
+  \edef\pgf at doma{\pgf at sys@tonumber{\pgf at x}}%
+  \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+  \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+  \edef\pgf at sys@shading at start@cmyk{\pgf at sys@cmyk}%
+  \let\pgf at sys@prevcolor=\pgf at sys@shading at start@cmyk%
+  \let\pgf at sys@prevpos=\pgf at sys@shading at start@pos%
+  \edef\pgf at prevcolor{\pgf at cmyk}%
+  \edef\pgf at firstcolor{\pgf at cmyk}}
+\def\pgf at parselastdomcmyk[cmyk(#1)=(#2,#3,#4,#5); {%
+  \pgfutil at ifnextchar]{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at end@pos{\the\pgf at x}%
+    \pgf at max=\pgf at x\relax%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at domb{\pgf at sys@tonumber{\pgf at x}}%
+    \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+    \edef\pgf at sys@shading at end@cmyk{\pgf at sys@cmyk}%
+    \pgfutil at gobble}{\pgf at parselastdomcmyk[}}
+\def\pgf at parsemidcmyk[cmyk(#1)=(#2,#3,#4,#5); {\pgf at parserestcmyk[}
+\def\pgf at parserestcmyk[cmyk(#1)=(#2,#3,#4,#5); {%
+  \advance\pgf at sys@shading at range@num by1\relax%
+  \pgfutil at ifnextchar]{%
+    \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at psfuncs{\pgf at prevx\space
+      \pgf at cmyk\space \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@cmyk}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@cmyk%
+    \pgfutil at gobble}{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@cmyk}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@cmyk%
+    \edef\pgf at psfuncs{\pgf at prevx\space \pgf at cmyk\space
+      \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at bounds{\pgf at bounds\space\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at encode{\pgf at encode\space0 1}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at prevcolor{\pgf at cmyk}%
+    \pgf at parserestcmyk[}}
+\def\pgf at getcmyktuplewithmixin#1#2#3#4{%
+  \pgfutil at definecolor{pgfshadetemp}{cmyk}{#1,#2,#3,#4}%
+  \pgfutil at ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}%
+  \pgfutil at extractcolorspec{pgfshadetemp}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{cmyk}{\pgf at cmykcolor}%
+  \expandafter\pgf at getcmyk@@\pgf at cmykcolor!}
+\def\pgf at getcmyk@@#1,#2,#3,#4!{%
+  \def\pgf at cmyk{#1 #2 #3 #4}%
+  \def\pgf at sys@cmyk{{#1}{#2}{#3}{#4}}%
+}
+%    \end{macrocode}
+%
+% \noindent Define new grayscale parsing macros.
+%
+%    \begin{macrocode}
+\def\pgf at parsefirstgray[gray(#1)=(#2)#3]{%
+  \pgfmathsetlength\pgf at x{#1}%
+  \edef\pgf at sys@shading at start@pos{\the\pgf at x}%
+  \pgf at sys@bp at correct\pgf at x%
+  \edef\pgf at doma{\pgf at sys@tonumber{\pgf at x}}%
+  \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+  \pgf at getgraytuplewithmixin{#2}%
+  \edef\pgf at sys@shading at start@gray{\pgf at sys@gray}%
+  \let\pgf at sys@prevcolor=\pgf at sys@shading at start@gray%
+  \let\pgf at sys@prevpos=\pgf at sys@shading at start@pos%
+  \edef\pgf at prevcolor{\pgf at gray}%
+  \edef\pgf at firstcolor{\pgf at gray}}
+\def\pgf at parselastdomgray[gray(#1)=(#2); {%
+  \pgfutil at ifnextchar]{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at end@pos{\the\pgf at x}%
+    \pgf at max=\pgf at x\relax%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at domb{\pgf at sys@tonumber{\pgf at x}}%
+    \pgf at getgraytuplewithmixin{#2}%
+    \edef\pgf at sys@shading at end@gray{\pgf at sys@gray}%
+    \pgfutil at gobble}{\pgf at parselastdomgray[}}
+\def\pgf at parsemidgray[gray(#1)=(#2); {\pgf at parserestgray[}
+\def\pgf at parserestgray[gray(#1)=(#2); {%
+  \advance\pgf at sys@shading at range@num by1\relax%
+  \pgfutil at ifnextchar]{%
+    \pgf at getgraytuplewithmixin{#2}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at psfuncs{\pgf at prevx\space \pgf at gray\space
+      \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@gray}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@gray%
+    \pgfutil at gobble}{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \pgf at getgraytuplewithmixin{#2}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@gray}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@gray%
+    \edef\pgf at psfuncs{\pgf at prevx\space \pgf at gray\space
+      \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at bounds{\pgf at bounds\space\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at encode{\pgf at encode\space0 1}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at prevcolor{\pgf at gray}%
+    \pgf at parserestgray[}}
+\def\pgf at getgraytuplewithmixin#1{%
+  \pgfutil at definecolor{pgfshadetemp}{gray}{#1}%
+  \pgfutil at ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}%
+  \pgfutil at extractcolorspec{pgfshadetemp}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{gray}{\pgf at graycolor}%
+  \expandafter\pgf at getgray@@\pgf at graycolor!}
+\def\pgf at getgray@@#1!{%
+  \def\pgf at gray{#1}%
+  \def\pgf at sys@gray{{#1}}%
+}
+%    \end{macrocode}
+%
+% \noindent Define new colour space agnostic colour specification parsing
+% macros. This includes parsing CMYK colour specifications (i.e.,
+% |color(|\meta{postition}|)=(|\meta{C}|,|\meta{M}|,|\meta{Y}|,|\meta{K}|)|.
+%
+%    \begin{macrocode}
+\def\pgf at convertstring#1{%
+  \def\pgf at conv{}%
+  \pgf at convert#1]%
+  }
+\def\pgf at convert{%
+  \pgfutil at ifnextchar]{\pgfutil at gobble}%done!
+  {%
+    \pgfutil at ifnextchar;{\pgf at grabsemicolor}%
+    {%
+      \pgfutil at ifnextchar c{\pgf at gobblec}%
+      {%
+        \pgfutil at ifnextchar g{\pgf at grabgray}%
+        {%
+          \pgfutil at ifnextchar o{\pgf at grabcolor}%
+          {%
+            \pgfutil at ifnextchar m{\pgf at grabcmyk}%
+            {%
+              \pgfutil at ifnextchar r{\pgf at grabrgb}%
+                {\pgferror{Illformed shading
+                 specification}\pgf at convert}%
+            }%
+          }%
+        }%
+      }%
+    }%
+  }%
+}
+\def\pgf at grabsemicolor;{%
+  \edef\pgf at conv{\pgf at conv; }\pgf at convert}
+\def\pgf at gobblec c{\pgf at convert}
+\def\pgf at savecolor#1{
+  \pgfutil at extractcolorspec{pgf at tempcol}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor%
+    {\pgf at shading@model}{\pgf at color}%
+  \expandafter\pgf at convget@\expandafter{\pgf at color}{#1}%
+}
+\def\pgf at grabrgb rgb(#1)=(#2,#3,#4){%
+  \pgfutil at definecolor{pgf at tempcol}{rgb}{#2,#3,#4}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at grabcmyk myk(#1)=(#2,#3,#4,#5){%
+  \pgfutil at definecolor{pgf at tempcol}{cmyk}{#2,#3,#4,#5}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at grabgray gray(#1)=(#2){%
+  \pgfutil at definecolor{pgf at tempcol}{gray}{#2}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at grabcolor olor(#1)=(#2){%
+  \pgfutil at colorlet{pgf at tempcol}{#2}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at convget@#1#2{%
+  \edef\pgf at conv{\pgf at conv \pgf at shading@model(#2)=(#1)}\pgf at convert}
+%    \end{macrocode}
+%
+% \noindent New macros to convert CMYK colours to a format suitable for use in
+% the \meta{type 4 function} argument of \cs{pgfdeclarefunctionalshading}.
+%
+%    \begin{macrocode}
+\newdimen\pgf at xd
+\def\pgfshadecolortocmyk#1#2{%
+  \pgfutil at colorlet{pgf at tempcol}{#1}%
+  \pgfutil at extractcolorspec{pgf at tempcol}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{cmyk}{\pgf at cmykcolor}%
+  \expandafter\pgfshading at cmyk\pgf at cmykcolor\relax%
+  \edef#2{\pgf at sys@tonumber{\pgf at xa}\space\pgf at sys@tonumber{\pgf at xb}\space
+    \pgf at sys@tonumber{\pgf at xc}\space\pgf at sys@tonumber{\pgf at xd}\space}%
+  \c at pgf@counta\escapechar%
+  \escapechar-1\relax%
+  \expandafter\edef\csname\string#2cyan\endcsname{%
+    \pgf at sys@tonumber{\pgf at xa}\space}%
+  \expandafter\edef\csname\string#2magenta\endcsname{%
+    \pgf at sys@tonumber{\pgf at xb}\space}%
+  \expandafter\edef\csname\string#2yellow\endcsname{%
+    \pgf at sys@tonumber{\pgf at xc}\space}%
+  \expandafter\edef\csname\string#2black\endcsname{%
+    \pgf at sys@tonumber{\pgf at xd}\space}%
+  \escapechar\c at pgf@counta%
+}
+\def\pgfshading at cmyk#1,#2,#3,#4\relax{%
+  \pgf at xa=#1pt%
+  \pgf at xb=#2pt%
+  \pgf at xc=#3pt%
+  \pgf at xd=#4pt%
+}
+%    \end{macrocode}
+%
+% \noindent New macros to convert grayscale colours to a format suitable for
+% use in the \meta{type 4 function} argument of
+% \cs{pgfdeclarefunctionalshading}.
+%
+%    \begin{macrocode}
+\def\pgfshadecolortogray#1#2{%
+  \pgfutil at colorlet{pgf at tempcol}{#1}%
+  \pgfutil at extractcolorspec{pgf at tempcol}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{gray}{\pgf at graycolor}%
+  \expandafter\pgfshading at gray\pgf at graycolor\relax%
+  \edef#2{\pgf at sys@tonumber{\pgf at xa}\space}%
+  \c at pgf@counta\escapechar%
+  \escapechar-1\relax%
+  \expandafter\edef\csname\string#2gray\endcsname{%
+    \pgf at sys@tonumber{\pgf at xa}\space}%
+  \escapechar\c at pgf@counta%
+}
+\def\pgfshading at gray#1\relax{%
+  \pgf at xa=#1pt%
+}
+%    \end{macrocode}
+%
+% \noindent Ensure colour model is set up based on the current \pkg{xcolor}
+% colour model when declaring shadings.
+%
+%    \begin{macrocode}
+\def\pgfdeclarehorizontalshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[%
+    \pgf at declarehorizontalshading{\pgf at declarehorizontalshading[]}}
+\def\pgfdeclareverticalshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[%
+    \pgf at declareverticalshading{\pgf at declareverticalshading[]}}
+\def\pgfdeclareradialshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[%
+    \pgf at declareradialshading{\pgf at declareradialshading[]}}
+\def\pgfdeclarefunctionalshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[
+    \pgf at declarefunctionalshading{\pgf at declarefunctionalshading[]}}
+%    \end{macrocode}
+%
+% \noindent Ensure colour model is set up based on the current \pkg{xcolor}
+% colour model when using shadings.
+%
+%    \begin{macrocode}
+\def\pgfuseshading#1{%
+  \edef\pgf at shadingname{@pgfshading#1}%
+  \edef\pgf at shadingsavedmodel{@pgfshading#1 at model}%
+  \pgf at tryextensions{\pgf at shadingname}{\pgfalternateextension}%
+  \expandafter\pgfutil at ifundefined\expandafter{\pgf at shadingname}%
+  {\pgferror{Undefined shading "#1"}}%
+  {%
+    {%
+      \pgf at setup@model
+      \pgfutil at globalcolorsfalse%
+      \def\pgf at shade@adds{}%
+      \pgfutil at ifundefined{pgf at deps\pgf at shadingname}%
+      {}%
+      {%
+        \edef\@list{\csname pgf at deps\pgf at shadingname\endcsname}%
+        \pgfutil at for\@temp:=\@list\do{%
+          {%
+            \pgfutil at ifundefined{applycolormixins}%
+              {}{\applycolormixins{\@temp}}%
+            \pgfutil at extractcolorspec{\@temp}{\pgf at tempcolor}%
+            \expandafter\pgfutil at ifundefined\expandafter{%
+              \pgf at shadingsavedmodel}
+              {\expandafter\pgfutil at convertcolorspec\pgf at tempcolor{%
+                 \pgf at shading@model}{\pgf at color}}%
+              {\expandafter\pgfutil at convertcolorspec\pgf at tempcolor{%
+                 \pgf at shadingsavedmodel}{\pgf at color}}%
+            \xdef\pgf at shade@adds{\pgf at shade@adds,\pgf at color}%
+          }%
+        }%
+      }%
+      \expandafter\pgf at strip@shadename\pgf at shadingname!!%
+      \pgfutil at ifundefined{@pgfshading\pgf at basename\pgf at shade@adds!}%
+      {%
+        {%
+          \expandafter\def\expandafter\@temp\expandafter{%
+            \csname pgf at func\pgf at shadingname\endcsname}%
+          \edef\@args{{\pgf at basename\pgf at shade@adds}}%
+          \expandafter\expandafter\expandafter\def%
+          \expandafter\expandafter\expandafter\@@args%
+          \expandafter\expandafter\expandafter{%
+            \csname pgf at args\pgf at shadingname\endcsname}%
+          \expandafter\expandafter\expandafter\@temp\expandafter\@args\@@args%
+          %
+        }%
+      }%
+      {}%
+      \pgf at invokeshading{%
+        \csname @pgfshading\pgf at basename\pgf at shade@adds!\endcsname}%
+    }%
+  }%
+}
+%    \end{macrocode}
+%
+% \noindent Conditionals for use in the \meta{type 4 function} argument of
+% \cs{pgfdeclarefunctionalshading} to test for the currently active
+% \pkg{xcolor} colour model.
+%
+%    \begin{macrocode}
+\newif\ifpgfshadingmodelrgb
+\newif\ifpgfshadingmodelcmyk
+\newif\ifpgfshadingmodelgray
+%    \end{macrocode}
+%
+% \noindent Shading colour space property set up based on the currently active
+% \pkg{xcolor} colour model.
+%
+%    \begin{macrocode}
+\def\pgf at setup@model{%
+  \pgfshadingmodelrgbtrue
+  \pgfshadingmodelcmykfalse
+  \pgfshadingmodelgrayfalse
+  \XC at sdef\pgf at mod@test{\XC at tgt@mod{natural}}%
+  \def\pgf at shading@functional at range{0 1 0 1 0 1}%
+  \def\pgf at shading@device{/DeviceRGB}%
+  \def\pgf at shading@model{rgb}%
+  \ifx\pgf at mod@test\XC at mod@natural
+    \ifpgfcmykshadingdefault
+      \def\pgf at shading@functional at range{0 1 0 1 0 1 0 1}%
+      \def\pgf at shading@device{/DeviceCMYK}%
+      \def\pgf at shading@model{cmyk}%
+      \pgfshadingmodelrgbfalse
+      \pgfshadingmodelcmyktrue
+    \else
+      \def\pgf at shading@functional at range{0 1 0 1 0 1}%
+      \def\pgf at shading@device{/DeviceRGB}%
+      \def\pgf at shading@model{rgb}%
+    \fi
+  \fi
+  \ifx\pgf at mod@test\XC at mod@cmyk
+    \def\pgf at shading@functional at range{0 1 0 1 0 1 0 1}%
+    \def\pgf at shading@device{/DeviceCMYK}%
+    \def\pgf at shading@model{cmyk}%
+      \pgfshadingmodelrgbfalse
+      \pgfshadingmodelcmyktrue
+  \fi
+  \ifx\pgf at mod@test\XC at mod@gray
+    \def\pgf at shading@functional at range{0 1}%
+    \def\pgf at shading@device{/DeviceGray}%
+    \def\pgf at shading@model{gray}%
+      \pgfshadingmodelrgbfalse
+      \pgfshadingmodelgraytrue
+  \fi
+}
+%    \end{macrocode}
+%
+% \noindent Converters for use in the \meta{type 4 function} argument of
+% \cs{pgfdeclarefunctionalshading}. These macros use the same algorithms as
+% \pkg{xcolor}.
+%
+%    \begin{macrocode}
+\def\pgffuncshadingrgbtocmyk{%
+  1.0 exch sub 3 1 roll
+  1.0 exch sub 3 1 roll
+  1.0 exch sub 3 1 roll
+  3 copy
+  2 copy gt { exch } if pop
+  2 copy gt { exch } if pop
+  dup 3 1 roll sub
+  0.0 2 copy lt { exch } if pop
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  dup 3 1 roll sub
+  0.0 2 copy lt { exch } if pop
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  dup 3 1 roll sub
+  0.0 2 copy lt { exch } if pop
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+}
+\def\pgffuncshadingrgbtogray{%
+  0.11 mul exch 0.59 mul add exch 0.3 mul add
+}
+\def\pgffuncshadingcmyktorgb{%
+  % covert to CMY
+  dup 3 1 roll add
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  dup 3 1 roll add
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  add
+  1.0 2 copy gt { exch } if pop
+  3 1 roll
+  % covert to RGB
+  1.0 exch sub
+  3 1 roll
+  1.0 exch sub
+  3 1 roll
+  1.0 exch sub
+  3 1 roll
+}
+\def\pgffuncshadingcmyktogray{%
+  exch 0.11 mul add exch 0.59 mul add exch 0.3 mul add
+  1.0 2 copy gt { exch } if pop
+  1.0 exch sub
+}
+\def\pgffuncshadinggraytorgb{%
+  dup dup
+}
+\def\pgffuncshadinggraytocmyk{%
+  0.0 0.0 0.0
+  4 3 roll
+}
+%    \end{macrocode}
+%
+% \noindent Load the correct driver file.
+%
+%    \begin{macrocode}
+\def\pgfutilgetcmykshadingsdriver{%
+  \expandafter\pgfutil at getcmykshadingsdriver\pgfsysdriver[
+}
+\def\pgfutil at getcmykshadingsdriver pgfsys-#1[{%
+  \edef\pgfsyscmykshadingsdriver{pgfsys-cmykshadings-#1}%
+}
+\pgfutilgetcmykshadingsdriver
+\input\pgfsyscmykshadingsdriver
+%    \end{macrocode}
+%
+% \noindent Style options to use CMYK shadings by default or not when the
+% selected \pkg{xcolor} colour model is |natural|.
+%
+%    \begin{macrocode}
+\newif\ifpgfcmykshadingdefault
+\DeclareOption{cmyk}{%
+  \pgfcmykshadingdefaulttrue
+}
+\DeclareOption{rgb}{%
+  \pgfcmykshadin at defaultfalse
+}
+\ExecuteOptions{cmyk}
+\ProcessOptions\relax
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</package>
+%    \end{macrocode}
+%
+% \subsection{Drivers}
+%
+% \subsubsection{pdftex driver}
+%
+%    \begin{macrocode}
+%<*pdftex-driver>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\ProvidesFile{pgfsys-cmykshadings-pdftex.def}%
+  [2018/10/17 CMYK shadings support for PGF pdftex driver (DCP)]
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\pgfsys at horishading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at max{%
+      \vbox to\pgfmathresult pt{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \immediate\pdfxform resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at doma\space0 \pgf at domb\space0]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\pdfrefxform\the\pdflastxform}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at vertshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgfmathresult pt{%
+      \vbox to\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{#2}{\pgf at max}}%
+    \immediate\pdfxform resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [0 \pgf at doma\space0 \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\pdfrefxform\the\pdflastxform}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at radialshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \setbox\pgfutil at tempboxa=\hbox to2\pgf at max{%
+      \vbox to2\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{\pgfpoint{\pgf at max}{\pgf at max}}%
+    \advance\pgf at xa by \pgf at x%
+    \advance\pgf at ya by \pgf at y%
+    \pgf at sys@bp at correct{\pgf at x}%
+    \pgf at sys@bp at correct{\pgf at y}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \immediate\pdfxform resources {%
+      /Shading << /Sh << /ShadingType 3
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at sys@tonumber{\pgf at xa}
+        \pgf at sys@tonumber{\pgf at ya}
+        \pgf at doma\space
+        \pgf at sys@tonumber{\pgf at x}
+        \pgf at sys@tonumber{\pgf at y}
+        \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [true false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\pdfrefxform\the\pdflastxform}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at functionalshading#1#2#3#4{%
+  {%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{#3}%
+    \pgf at xb=\pgf at x%
+    \pgf at yb=\pgf at y%
+    \advance\pgf at x by-\pgf at xa%
+    \advance\pgf at y by-\pgf at ya%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at x{%
+      \vbox to\pgf at y{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgf at sys@bp at correct{\pgf at xb}%
+    \pgf at sys@bp at correct{\pgf at yb}%
+    \pgf at xc=-\pgf at xa%
+    \pgf at yc=-\pgf at ya%
+    % Now build the function
+    \pdfobj
+    stream
+    attr
+    {
+      /FunctionType 4
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Range [\pgf at shading@functional at range]
+    }
+    {{#4}}%
+    \edef\pgf at temp@num{\the\pdflastobj}%
+    \pdfxform resources {%
+      /Shading << /Sh << /ShadingType 1
+      /ColorSpace \pgf at shading@device\space
+      /Matrix [1 0 0 1 \pgf at sys@tonumber{\pgf at xc}\space
+        \pgf at sys@tonumber{\pgf at yc}]
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Function \pgf at temp@num\space 0 R
+      >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode%
+      \noexpand\pdfrefxform\the\pdflastxform%
+      \noexpand\pdfrefobj\pgf at temp@num%
+    }%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</pdftex-driver>
+%    \end{macrocode}
+%
+% \subsubsection{xetex driver}
+%
+%    \begin{macrocode}
+%<*xetex-driver>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\ProvidesFile{pgfsys-cmykshadings-xetex.def}%
+  [2018/10/17 CMYK shadings support for PGF xetex driver (DCP)]
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\input pgfsys-cmykshadings-dvipdfmx.def
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</xetex-driver>
+%    \end{macrocode}
+%
+% \subsubsection{luatex driver}
+%
+%    \begin{macrocode}
+%<*luatex-driver>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\ProvidesFile{pgfsys-cmykshadings-luatex.def}%
+  [2018/10/17 CMYK shadings support for PGF luatex driver (DCP)]
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\pgfsys at horishading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at max{%
+      \vbox to\pgfmathresult pt{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \immediate\saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at doma\space0 \pgf at domb\space0]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\useboxresource\the\lastsavedboxresourceindex}% 
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at vertshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgfmathresult pt{%
+      \vbox to\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{#2}{\pgf at max}}%
+    \immediate\saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [0 \pgf at doma\space0 \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\useboxresource\the\lastsavedboxresourceindex}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at radialshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \setbox\pgfutil at tempboxa=\hbox to2\pgf at max{%
+      \vbox to2\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{\pgfpoint{\pgf at max}{\pgf at max}}%
+    \advance\pgf at xa by \pgf at x%
+    \advance\pgf at ya by \pgf at y%
+    \pgf at sys@bp at correct{\pgf at x}%
+    \pgf at sys@bp at correct{\pgf at y}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \immediate\saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 3
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at sys@tonumber{\pgf at xa}
+        \pgf at sys@tonumber{\pgf at ya}
+        \pgf at doma\space
+        \pgf at sys@tonumber{\pgf at x}
+        \pgf at sys@tonumber{\pgf at y}
+        \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [true false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\useboxresource\the\lastsavedboxresourceindex}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at functionalshading#1#2#3#4{%
+  {%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{#3}%
+    \pgf at xb=\pgf at x%
+    \pgf at yb=\pgf at y%
+    \advance\pgf at x by-\pgf at xa%
+    \advance\pgf at y by-\pgf at ya%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at x{%
+      \vbox to\pgf at y{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgf at sys@bp at correct{\pgf at xb}%
+    \pgf at sys@bp at correct{\pgf at yb}%
+    \pgf at xc=-\pgf at xa%
+    \pgf at yc=-\pgf at ya%
+    % Now build the function
+    \pdfextension obj
+    stream
+    attr
+    {
+      /FunctionType 4
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Range [\pgf at shading@functional at range]
+    }
+    {{#4}}%
+    \edef\pgf at temp@num{\the\numexpr\pdffeedback lastobj\relax}%
+    \saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 1
+      /ColorSpace \pgf at shading@device\space
+      /Matrix [1 0 0 1 \pgf at sys@tonumber{\pgf at xc}\space
+        \pgf at sys@tonumber{\pgf at yc}]
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Function \pgf at temp@num\space 0 R
+      >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode%
+      \noexpand\useboxresource\the\lastsavedboxresourceindex%
+      \noexpand\pdfextension refobj \pgf at temp@num%
+    }%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</luatex-driver>
+%    \end{macrocode}
+%
+% \subsubsection{dvipdfmx driver}
+%
+%    \begin{macrocode}
+%<*dvipdfmx-driver>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\ProvidesFile{pgfsys-cmykshadings-dvipdfmx.def}%
+  [2018/10/17 CMYK shadings support for PGF dvipdfmx driver (DCP)]
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\pgfsys at horishading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \the\pgf at max\space height \pgfmathresult pt}%
+      \special{pdf:put @resources
+      <<
+        /Shading << /Sh << /ShadingType 2
+        /ColorSpace \pgf at shading@device\space
+        /Domain [\pgf at pdfparseddomain]
+        /Coords [\pgf at doma\space0 \pgf at domb\space0]
+        /Function \pgf at pdfparsedfunction
+        /Extend [false false] >> >>
+      >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \hbox to\the\pgf at max{\vbox to\pgfmathresult pt{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+\def\pgfsys at vertshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \pgfmathresult pt\space height \the\pgf at max}%
+      \special{pdf:put @resources
+      <<
+        /Shading << /Sh << /ShadingType 2
+        /ColorSpace \pgf at shading@device\space
+        /Domain [\pgf at pdfparseddomain]
+        /Coords [0 \pgf at doma\space0 \pgf at domb]
+        /Function \pgf at pdfparsedfunction
+        /Extend [false false] >> >>
+      >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \hbox to\pgfmathresult pt{\vbox to\the\pgf at max{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}% 
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+\def\pgfsys at radialshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{\pgfpoint{\pgf at max}{\pgf at max}}%
+    \advance\pgf at xa by \pgf at x%
+    \advance\pgf at ya by \pgf at y%
+    \pgf at sys@bp at correct{\pgf at x}%
+    \pgf at sys@bp at correct{\pgf at y}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgfutil at tempdima=2\pgf at max%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \the\pgfutil at tempdima\space height \the\pgfutil at tempdima}%
+      \special{pdf:put @resources
+      <<
+        /Shading << /Sh << /ShadingType 3
+        /ColorSpace \pgf at shading@device\space
+        /Domain [\pgf at pdfparseddomain]
+        /Coords [\pgf at sys@tonumber{\pgf at xa}
+          \pgf at sys@tonumber{\pgf at ya}
+          \pgf at doma\space \pgf at sys@tonumber{\pgf at x}
+          \pgf at sys@tonumber{\pgf at y}
+          \pgf at domb]
+        /Function \pgf at pdfparsedfunction
+        /Extend [true false] >> >>
+      >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \hbox to\the\pgfutil at tempdima{\vbox to\the\pgfutil at tempdima{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}% 
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+\def\pgfsys at functionalshading#1#2#3#4{%
+  {%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{#3}%
+    \pgf at xb=\pgf at x%
+    \pgf at yb=\pgf at y%
+    \advance\pgf at x by-\pgf at xa%
+    \advance\pgf at y by-\pgf at ya%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgf at sys@bp at correct{\pgf at xb}%
+    \pgf at sys@bp at correct{\pgf at yb}%
+    \pgf at xc=-\pgf at xa%
+    \pgf at yc=-\pgf at ya%
+    % Now build the function
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:stream @pgfstream\the\pgfsys at objnum\space({#4})
+        <</FunctionType 4 /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+          \pgf at sys@tonumber{\pgf at xb}\space
+          \pgf at sys@tonumber{\pgf at ya}\space
+          \pgf at sys@tonumber{\pgf at yb}]
+        /Range [\pgf at shading@functional at range]>>}}}\@tempa%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \the\pgf at x\space height \the\pgf at y}%
+      \special{pdf:put @resources <</Shading <</Sh <</ShadingType 1
+        /ColorSpace \pgf at shading@device\space
+        /Matrix [1 0 0 1 \pgf at sys@tonumber{\pgf at xc}\space
+          \pgf at sys@tonumber{\pgf at yc}]
+        /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+          \pgf at sys@tonumber{\pgf at xb}\space
+          \pgf at sys@tonumber{\pgf at ya}\space
+          \pgf at sys@tonumber{\pgf at yb}]
+        /Function @pgfstream\the\pgfsys at objnum>> >> >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\hbox to\the\pgf at x{\vbox to\the\pgf at y{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}% 
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%</dvipdfmx-driver>
+%    \end{macrocode}
+%
+% \end{implementation}
+%
+% \PrintChanges


Property changes on: trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/pgf-cmykshadings/pgf-cmykshadings.ins	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,66 @@
+\iffalse meta-comment
+
+Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+
+This work may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3c 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
+and version 1.3c or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+\fi
+
+\input l3docstrip.tex
+\askforoverwritefalse
+
+\preamble
+
+This is a generated file.
+
+Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+
+This work may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3c 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
+and version 1.3c or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work is "maintained" (as per the LPPL maintenance status)
+by David Purton.
+
+This work consists of the files pgf-cmykshadings.ins,
+pgf-cmykshadings.dtx, README.md, and the derived files
+  - pgf-cmykshadings.sty
+  - pgfsys-cmykshadings-pdftex.def
+  - pgfsys-cmykshadgins-xetex.def
+  - pgfsys-cmykshadings-luatex.def
+  - pgfsys-cmykshadings-dvipdfmx.def
+  - pgf-cmykshadings.pdf
+
+
+Substantial parts of the code for this package are taken from the pgf
+package files pgfcoreshade.code.tex, pgfsys-pdftex.def,
+pgfsys-luatex.def, and pgfsys-dvipdfmx.def copyright (c) 2006 Till
+Tantau and then slightly modified to support CMYK and grayscale
+shadings.
+
+\endpreamble
+
+\postamble
+\endpostamble
+
+\keepsilent
+
+\generate{\file{pgf-cmykshadings.sty}{\from{pgf-cmykshadings.dtx}{package}}
+  \file{pgfsys-cmykshadings-pdftex.def}{\from{pgf-cmykshadings.dtx}{pdftex-driver}}
+  \file{pgfsys-cmykshadings-xetex.def}{\from{pgf-cmykshadings.dtx}{xetex-driver}}
+  \file{pgfsys-cmykshadings-luatex.def}{\from{pgf-cmykshadings.dtx}{luatex-driver}}
+  \file{pgfsys-cmykshadings-dvipdfmx.def}{\from{pgf-cmykshadings.dtx}{dvipdfmx-driver}}
+}
+
+\endbatchfile
+

Added: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgf-cmykshadings.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgf-cmykshadings.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgf-cmykshadings.sty	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,490 @@
+%%
+%% This is file `pgf-cmykshadings.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pgf-cmykshadings.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+%% 
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c 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
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work is "maintained" (as per the LPPL maintenance status)
+%% by David Purton.
+%% 
+%% This work consists of the files pgf-cmykshadings.ins,
+%% pgf-cmykshadings.dtx, README.md, and the derived files
+%%   - pgf-cmykshadings.sty
+%%   - pgfsys-cmykshadings-pdftex.def
+%%   - pgfsys-cmykshadgins-xetex.def
+%%   - pgfsys-cmykshadings-luatex.def
+%%   - pgfsys-cmykshadings-dvipdfmx.def
+%%   - pgf-cmykshadings.pdf
+%% 
+%% 
+%% Substantial parts of the code for this package are taken from the pgf
+%% package files pgfcoreshade.code.tex, pgfsys-pdftex.def,
+%% pgfsys-luatex.def, and pgfsys-dvipdfmx.def copyright (c) 2006 Till
+%% Tantau and then slightly modified to support CMYK and grayscale
+%% shadings.
+%% 
+\ProvidesPackage{pgf-cmykshadings}%
+  [2018/10/17 CMYK shadings support for PGF (DCP)]
+\RequirePackage{pgf}
+\def\pgf at parsefunc#1{%
+  \edef\temp{{#1}}%
+  \expandafter\pgf at convertstring\temp%
+  \edef\temp{{\pgf at conv}}%
+  \expandafter\pgf@@parsefunc\temp}
+\def\pgf@@parsefunc#1{%
+  \let\pgf at bounds=\pgfutil at empty%
+  \let\pgf at funcs=\pgfutil at empty%
+  \let\pgf at psfuncs=\pgfutil at empty%
+  \let\pgf at encode=\pgfutil at empty%
+  \let\pgf at sys@shading at ranges=\pgfutil at empty%
+  \pgf at sys@shading at range@num=0\relax%
+  \csname pgf at parsefirst\pgf at shading@model\endcsname[#1; ]%
+  \csname pgf at parselastdom\pgf at shading@model\endcsname[#1; ]%
+  \csname pgf at parsemid\pgf at shading@model\endcsname[#1; ]%
+  \ifx\pgf at bounds\pgfutil at empty%
+    \edef\pgf at pdfparseddomain{0 1}%
+    \edef\pgf at pdfparsedfunction{\pgf at singlefunc\space}%
+  \else%
+    \edef\pgf at pdfparseddomain{\pgf at doma\space\pgf at domb}%
+    \edef\pgf at pdfparsedfunction{%
+      << /FunctionType 3 /Domain [\pgf at doma\space\pgf at domb] /Functions
+      [\pgf at funcs\space] /Bounds [\pgf at bounds] /Encode [0 1 \pgf at encode]
+      >> }% <<
+  \fi%
+  \xdef\pgf at psfuncs{\pgf at psfuncs}%
+  }
+\let\pgf at parsefirstrgb\pgf at parsefirst
+\let\pgf at parselastdomrgb\pgf at parselastdom
+\let\pgf at parsemidrgb\pgf at parsemid
+\let\pgf at parserestrgb\pgf at parserest
+\def\pgf at parsefirstcmyk[cmyk(#1)=(#2,#3,#4,#5)#6]{%
+  \pgfmathsetlength\pgf at x{#1}%
+  \edef\pgf at sys@shading at start@pos{\the\pgf at x}%
+  \pgf at sys@bp at correct\pgf at x%
+  \edef\pgf at doma{\pgf at sys@tonumber{\pgf at x}}%
+  \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+  \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+  \edef\pgf at sys@shading at start@cmyk{\pgf at sys@cmyk}%
+  \let\pgf at sys@prevcolor=\pgf at sys@shading at start@cmyk%
+  \let\pgf at sys@prevpos=\pgf at sys@shading at start@pos%
+  \edef\pgf at prevcolor{\pgf at cmyk}%
+  \edef\pgf at firstcolor{\pgf at cmyk}}
+\def\pgf at parselastdomcmyk[cmyk(#1)=(#2,#3,#4,#5); {%
+  \pgfutil at ifnextchar]{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at end@pos{\the\pgf at x}%
+    \pgf at max=\pgf at x\relax%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at domb{\pgf at sys@tonumber{\pgf at x}}%
+    \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+    \edef\pgf at sys@shading at end@cmyk{\pgf at sys@cmyk}%
+    \pgfutil at gobble}{\pgf at parselastdomcmyk[}}
+\def\pgf at parsemidcmyk[cmyk(#1)=(#2,#3,#4,#5); {\pgf at parserestcmyk[}
+\def\pgf at parserestcmyk[cmyk(#1)=(#2,#3,#4,#5); {%
+  \advance\pgf at sys@shading at range@num by1\relax%
+  \pgfutil at ifnextchar]{%
+    \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at psfuncs{\pgf at prevx\space
+      \pgf at cmyk\space \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@cmyk}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@cmyk%
+    \pgfutil at gobble}{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \pgf at getcmyktuplewithmixin{#2}{#3}{#4}{#5}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@cmyk}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@cmyk%
+    \edef\pgf at psfuncs{\pgf at prevx\space \pgf at cmyk\space
+      \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at bounds{\pgf at bounds\space\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at encode{\pgf at encode\space0 1}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at cmyk] /N 1 >> }% <<
+    \edef\pgf at prevcolor{\pgf at cmyk}%
+    \pgf at parserestcmyk[}}
+\def\pgf at getcmyktuplewithmixin#1#2#3#4{%
+  \pgfutil at definecolor{pgfshadetemp}{cmyk}{#1,#2,#3,#4}%
+  \pgfutil at ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}%
+  \pgfutil at extractcolorspec{pgfshadetemp}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{cmyk}{\pgf at cmykcolor}%
+  \expandafter\pgf at getcmyk@@\pgf at cmykcolor!}
+\def\pgf at getcmyk@@#1,#2,#3,#4!{%
+  \def\pgf at cmyk{#1 #2 #3 #4}%
+  \def\pgf at sys@cmyk{{#1}{#2}{#3}{#4}}%
+}
+\def\pgf at parsefirstgray[gray(#1)=(#2)#3]{%
+  \pgfmathsetlength\pgf at x{#1}%
+  \edef\pgf at sys@shading at start@pos{\the\pgf at x}%
+  \pgf at sys@bp at correct\pgf at x%
+  \edef\pgf at doma{\pgf at sys@tonumber{\pgf at x}}%
+  \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+  \pgf at getgraytuplewithmixin{#2}%
+  \edef\pgf at sys@shading at start@gray{\pgf at sys@gray}%
+  \let\pgf at sys@prevcolor=\pgf at sys@shading at start@gray%
+  \let\pgf at sys@prevpos=\pgf at sys@shading at start@pos%
+  \edef\pgf at prevcolor{\pgf at gray}%
+  \edef\pgf at firstcolor{\pgf at gray}}
+\def\pgf at parselastdomgray[gray(#1)=(#2); {%
+  \pgfutil at ifnextchar]{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at end@pos{\the\pgf at x}%
+    \pgf at max=\pgf at x\relax%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at domb{\pgf at sys@tonumber{\pgf at x}}%
+    \pgf at getgraytuplewithmixin{#2}%
+    \edef\pgf at sys@shading at end@gray{\pgf at sys@gray}%
+    \pgfutil at gobble}{\pgf at parselastdomgray[}}
+\def\pgf at parsemidgray[gray(#1)=(#2); {\pgf at parserestgray[}
+\def\pgf at parserestgray[gray(#1)=(#2); {%
+  \advance\pgf at sys@shading at range@num by1\relax%
+  \pgfutil at ifnextchar]{%
+    \pgf at getgraytuplewithmixin{#2}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at psfuncs{\pgf at prevx\space \pgf at gray\space
+      \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgfmathsetlength\pgf at x{#1}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@gray}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@gray%
+    \pgfutil at gobble}{%
+    \pgfmathsetlength\pgf at x{#1}%
+    \pgf at getgraytuplewithmixin{#2}%
+    \edef\pgf at sys@shading at ranges{\pgf at sys@shading at ranges{%
+      {\pgf at sys@prevpos}{\the\pgf at x}{\pgf at sys@prevcolor}{\pgf at sys@gray}}}%
+    \edef\pgf at sys@prevpos{\the\pgf at x}%
+    \let\pgf at sys@prevcolor=\pgf at sys@gray%
+    \edef\pgf at psfuncs{\pgf at prevx\space \pgf at gray\space
+      \pgf at prevcolor\space pgfshade \pgf at psfuncs}%
+    \pgf at sys@bp at correct\pgf at x%
+    \edef\pgf at prevx{\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at bounds{\pgf at bounds\space\pgf at sys@tonumber{\pgf at x}}%
+    \edef\pgf at encode{\pgf at encode\space0 1}%
+    \edef\pgf at singlefunc{\space%
+      << /FunctionType 2 /Domain [0 1] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at funcs{\pgf at funcs\space%
+      << /FunctionType 2 /Domain [\pgf at doma\space\pgf at domb] /C0
+      [\pgf at prevcolor] /C1 [\pgf at gray] /N 1 >> }% <<
+    \edef\pgf at prevcolor{\pgf at gray}%
+    \pgf at parserestgray[}}
+\def\pgf at getgraytuplewithmixin#1{%
+  \pgfutil at definecolor{pgfshadetemp}{gray}{#1}%
+  \pgfutil at ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}%
+  \pgfutil at extractcolorspec{pgfshadetemp}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{gray}{\pgf at graycolor}%
+  \expandafter\pgf at getgray@@\pgf at graycolor!}
+\def\pgf at getgray@@#1!{%
+  \def\pgf at gray{#1}%
+  \def\pgf at sys@gray{{#1}}%
+}
+\def\pgf at convertstring#1{%
+  \def\pgf at conv{}%
+  \pgf at convert#1]%
+  }
+\def\pgf at convert{%
+  \pgfutil at ifnextchar]{\pgfutil at gobble}%done!
+  {%
+    \pgfutil at ifnextchar;{\pgf at grabsemicolor}%
+    {%
+      \pgfutil at ifnextchar c{\pgf at gobblec}%
+      {%
+        \pgfutil at ifnextchar g{\pgf at grabgray}%
+        {%
+          \pgfutil at ifnextchar o{\pgf at grabcolor}%
+          {%
+            \pgfutil at ifnextchar m{\pgf at grabcmyk}%
+            {%
+              \pgfutil at ifnextchar r{\pgf at grabrgb}%
+                {\pgferror{Illformed shading
+                 specification}\pgf at convert}%
+            }%
+          }%
+        }%
+      }%
+    }%
+  }%
+}
+\def\pgf at grabsemicolor;{%
+  \edef\pgf at conv{\pgf at conv; }\pgf at convert}
+\def\pgf at gobblec c{\pgf at convert}
+\def\pgf at savecolor#1{
+  \pgfutil at extractcolorspec{pgf at tempcol}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor%
+    {\pgf at shading@model}{\pgf at color}%
+  \expandafter\pgf at convget@\expandafter{\pgf at color}{#1}%
+}
+\def\pgf at grabrgb rgb(#1)=(#2,#3,#4){%
+  \pgfutil at definecolor{pgf at tempcol}{rgb}{#2,#3,#4}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at grabcmyk myk(#1)=(#2,#3,#4,#5){%
+  \pgfutil at definecolor{pgf at tempcol}{cmyk}{#2,#3,#4,#5}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at grabgray gray(#1)=(#2){%
+  \pgfutil at definecolor{pgf at tempcol}{gray}{#2}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at grabcolor olor(#1)=(#2){%
+  \pgfutil at colorlet{pgf at tempcol}{#2}%
+  \pgf at savecolor{#1}%
+}
+\def\pgf at convget@#1#2{%
+  \edef\pgf at conv{\pgf at conv \pgf at shading@model(#2)=(#1)}\pgf at convert}
+\newdimen\pgf at xd
+\def\pgfshadecolortocmyk#1#2{%
+  \pgfutil at colorlet{pgf at tempcol}{#1}%
+  \pgfutil at extractcolorspec{pgf at tempcol}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{cmyk}{\pgf at cmykcolor}%
+  \expandafter\pgfshading at cmyk\pgf at cmykcolor\relax%
+  \edef#2{\pgf at sys@tonumber{\pgf at xa}\space\pgf at sys@tonumber{\pgf at xb}\space
+    \pgf at sys@tonumber{\pgf at xc}\space\pgf at sys@tonumber{\pgf at xd}\space}%
+  \c at pgf@counta\escapechar%
+  \escapechar-1\relax%
+  \expandafter\edef\csname\string#2cyan\endcsname{%
+    \pgf at sys@tonumber{\pgf at xa}\space}%
+  \expandafter\edef\csname\string#2magenta\endcsname{%
+    \pgf at sys@tonumber{\pgf at xb}\space}%
+  \expandafter\edef\csname\string#2yellow\endcsname{%
+    \pgf at sys@tonumber{\pgf at xc}\space}%
+  \expandafter\edef\csname\string#2black\endcsname{%
+    \pgf at sys@tonumber{\pgf at xd}\space}%
+  \escapechar\c at pgf@counta%
+}
+\def\pgfshading at cmyk#1,#2,#3,#4\relax{%
+  \pgf at xa=#1pt%
+  \pgf at xb=#2pt%
+  \pgf at xc=#3pt%
+  \pgf at xd=#4pt%
+}
+\def\pgfshadecolortogray#1#2{%
+  \pgfutil at colorlet{pgf at tempcol}{#1}%
+  \pgfutil at extractcolorspec{pgf at tempcol}{\pgf at tempcolor}%
+  \expandafter\pgfutil at convertcolorspec\pgf at tempcolor{gray}{\pgf at graycolor}%
+  \expandafter\pgfshading at gray\pgf at graycolor\relax%
+  \edef#2{\pgf at sys@tonumber{\pgf at xa}\space}%
+  \c at pgf@counta\escapechar%
+  \escapechar-1\relax%
+  \expandafter\edef\csname\string#2gray\endcsname{%
+    \pgf at sys@tonumber{\pgf at xa}\space}%
+  \escapechar\c at pgf@counta%
+}
+\def\pgfshading at gray#1\relax{%
+  \pgf at xa=#1pt%
+}
+\def\pgfdeclarehorizontalshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[%
+    \pgf at declarehorizontalshading{\pgf at declarehorizontalshading[]}}
+\def\pgfdeclareverticalshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[%
+    \pgf at declareverticalshading{\pgf at declareverticalshading[]}}
+\def\pgfdeclareradialshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[%
+    \pgf at declareradialshading{\pgf at declareradialshading[]}}
+\def\pgfdeclarefunctionalshading{%
+  \pgf at setup@model
+  \pgfutil at ifnextchar[
+    \pgf at declarefunctionalshading{\pgf at declarefunctionalshading[]}}
+\def\pgfuseshading#1{%
+  \edef\pgf at shadingname{@pgfshading#1}%
+  \edef\pgf at shadingsavedmodel{@pgfshading#1 at model}%
+  \pgf at tryextensions{\pgf at shadingname}{\pgfalternateextension}%
+  \expandafter\pgfutil at ifundefined\expandafter{\pgf at shadingname}%
+  {\pgferror{Undefined shading "#1"}}%
+  {%
+    {%
+      \pgf at setup@model
+      \pgfutil at globalcolorsfalse%
+      \def\pgf at shade@adds{}%
+      \pgfutil at ifundefined{pgf at deps\pgf at shadingname}%
+      {}%
+      {%
+        \edef\@list{\csname pgf at deps\pgf at shadingname\endcsname}%
+        \pgfutil at for\@temp:=\@list\do{%
+          {%
+            \pgfutil at ifundefined{applycolormixins}%
+              {}{\applycolormixins{\@temp}}%
+            \pgfutil at extractcolorspec{\@temp}{\pgf at tempcolor}%
+            \expandafter\pgfutil at ifundefined\expandafter{%
+              \pgf at shadingsavedmodel}
+              {\expandafter\pgfutil at convertcolorspec\pgf at tempcolor{%
+                 \pgf at shading@model}{\pgf at color}}%
+              {\expandafter\pgfutil at convertcolorspec\pgf at tempcolor{%
+                 \pgf at shadingsavedmodel}{\pgf at color}}%
+            \xdef\pgf at shade@adds{\pgf at shade@adds,\pgf at color}%
+          }%
+        }%
+      }%
+      \expandafter\pgf at strip@shadename\pgf at shadingname!!%
+      \pgfutil at ifundefined{@pgfshading\pgf at basename\pgf at shade@adds!}%
+      {%
+        {%
+          \expandafter\def\expandafter\@temp\expandafter{%
+            \csname pgf at func\pgf at shadingname\endcsname}%
+          \edef\@args{{\pgf at basename\pgf at shade@adds}}%
+          \expandafter\expandafter\expandafter\def%
+          \expandafter\expandafter\expandafter\@@args%
+          \expandafter\expandafter\expandafter{%
+            \csname pgf at args\pgf at shadingname\endcsname}%
+          \expandafter\expandafter\expandafter\@temp\expandafter\@args\@@args%
+          %
+        }%
+      }%
+      {}%
+      \pgf at invokeshading{%
+        \csname @pgfshading\pgf at basename\pgf at shade@adds!\endcsname}%
+    }%
+  }%
+}
+\newif\ifpgfshadingmodelrgb
+\newif\ifpgfshadingmodelcmyk
+\newif\ifpgfshadingmodelgray
+\def\pgf at setup@model{%
+  \pgfshadingmodelrgbtrue
+  \pgfshadingmodelcmykfalse
+  \pgfshadingmodelgrayfalse
+  \XC at sdef\pgf at mod@test{\XC at tgt@mod{natural}}%
+  \def\pgf at shading@functional at range{0 1 0 1 0 1}%
+  \def\pgf at shading@device{/DeviceRGB}%
+  \def\pgf at shading@model{rgb}%
+  \ifx\pgf at mod@test\XC at mod@natural
+    \ifpgfcmykshadingdefault
+      \def\pgf at shading@functional at range{0 1 0 1 0 1 0 1}%
+      \def\pgf at shading@device{/DeviceCMYK}%
+      \def\pgf at shading@model{cmyk}%
+      \pgfshadingmodelrgbfalse
+      \pgfshadingmodelcmyktrue
+    \else
+      \def\pgf at shading@functional at range{0 1 0 1 0 1}%
+      \def\pgf at shading@device{/DeviceRGB}%
+      \def\pgf at shading@model{rgb}%
+    \fi
+  \fi
+  \ifx\pgf at mod@test\XC at mod@cmyk
+    \def\pgf at shading@functional at range{0 1 0 1 0 1 0 1}%
+    \def\pgf at shading@device{/DeviceCMYK}%
+    \def\pgf at shading@model{cmyk}%
+      \pgfshadingmodelrgbfalse
+      \pgfshadingmodelcmyktrue
+  \fi
+  \ifx\pgf at mod@test\XC at mod@gray
+    \def\pgf at shading@functional at range{0 1}%
+    \def\pgf at shading@device{/DeviceGray}%
+    \def\pgf at shading@model{gray}%
+      \pgfshadingmodelrgbfalse
+      \pgfshadingmodelgraytrue
+  \fi
+}
+\def\pgffuncshadingrgbtocmyk{%
+  1.0 exch sub 3 1 roll
+  1.0 exch sub 3 1 roll
+  1.0 exch sub 3 1 roll
+  3 copy
+  2 copy gt { exch } if pop
+  2 copy gt { exch } if pop
+  dup 3 1 roll sub
+  0.0 2 copy lt { exch } if pop
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  dup 3 1 roll sub
+  0.0 2 copy lt { exch } if pop
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  dup 3 1 roll sub
+  0.0 2 copy lt { exch } if pop
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+}
+\def\pgffuncshadingrgbtogray{%
+  0.11 mul exch 0.59 mul add exch 0.3 mul add
+}
+\def\pgffuncshadingcmyktorgb{%
+  % covert to CMY
+  dup 3 1 roll add
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  dup 3 1 roll add
+  1.0 2 copy gt { exch } if pop
+  4 1 roll
+  add
+  1.0 2 copy gt { exch } if pop
+  3 1 roll
+  % covert to RGB
+  1.0 exch sub
+  3 1 roll
+  1.0 exch sub
+  3 1 roll
+  1.0 exch sub
+  3 1 roll
+}
+\def\pgffuncshadingcmyktogray{%
+  exch 0.11 mul add exch 0.59 mul add exch 0.3 mul add
+  1.0 2 copy gt { exch } if pop
+  1.0 exch sub
+}
+\def\pgffuncshadinggraytorgb{%
+  dup dup
+}
+\def\pgffuncshadinggraytocmyk{%
+  0.0 0.0 0.0
+  4 3 roll
+}
+\def\pgfutilgetcmykshadingsdriver{%
+  \expandafter\pgfutil at getcmykshadingsdriver\pgfsysdriver[
+}
+\def\pgfutil at getcmykshadingsdriver pgfsys-#1[{%
+  \edef\pgfsyscmykshadingsdriver{pgfsys-cmykshadings-#1}%
+}
+\pgfutilgetcmykshadingsdriver
+\input\pgfsyscmykshadingsdriver
+\newif\ifpgfcmykshadingdefault
+\DeclareOption{cmyk}{%
+  \pgfcmykshadingdefaulttrue
+}
+\DeclareOption{rgb}{%
+  \pgfcmykshadin at defaultfalse
+}
+\ExecuteOptions{cmyk}
+\ProcessOptions\relax
+%% 
+%%
+%% End of file `pgf-cmykshadings.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgf-cmykshadings.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-dvipdfmx.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-dvipdfmx.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-dvipdfmx.def	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,184 @@
+%%
+%% This is file `pgfsys-cmykshadings-dvipdfmx.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pgf-cmykshadings.dtx  (with options: `dvipdfmx-driver')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+%% 
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c 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
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work is "maintained" (as per the LPPL maintenance status)
+%% by David Purton.
+%% 
+%% This work consists of the files pgf-cmykshadings.ins,
+%% pgf-cmykshadings.dtx, README.md, and the derived files
+%%   - pgf-cmykshadings.sty
+%%   - pgfsys-cmykshadings-pdftex.def
+%%   - pgfsys-cmykshadgins-xetex.def
+%%   - pgfsys-cmykshadings-luatex.def
+%%   - pgfsys-cmykshadings-dvipdfmx.def
+%%   - pgf-cmykshadings.pdf
+%% 
+%% 
+%% Substantial parts of the code for this package are taken from the pgf
+%% package files pgfcoreshade.code.tex, pgfsys-pdftex.def,
+%% pgfsys-luatex.def, and pgfsys-dvipdfmx.def copyright (c) 2006 Till
+%% Tantau and then slightly modified to support CMYK and grayscale
+%% shadings.
+%% 
+\ProvidesFile{pgfsys-cmykshadings-dvipdfmx.def}%
+  [2018/10/17 CMYK shadings support for PGF dvipdfmx driver (DCP)]
+\def\pgfsys at horishading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \the\pgf at max\space height \pgfmathresult pt}%
+      \special{pdf:put @resources
+      <<
+        /Shading << /Sh << /ShadingType 2
+        /ColorSpace \pgf at shading@device\space
+        /Domain [\pgf at pdfparseddomain]
+        /Coords [\pgf at doma\space0 \pgf at domb\space0]
+        /Function \pgf at pdfparsedfunction
+        /Extend [false false] >> >>
+      >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \hbox to\the\pgf at max{\vbox to\pgfmathresult pt{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+\def\pgfsys at vertshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \pgfmathresult pt\space height \the\pgf at max}%
+      \special{pdf:put @resources
+      <<
+        /Shading << /Sh << /ShadingType 2
+        /ColorSpace \pgf at shading@device\space
+        /Domain [\pgf at pdfparseddomain]
+        /Coords [0 \pgf at doma\space0 \pgf at domb]
+        /Function \pgf at pdfparsedfunction
+        /Extend [false false] >> >>
+      >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \hbox to\pgfmathresult pt{\vbox to\the\pgf at max{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+\def\pgfsys at radialshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{\pgfpoint{\pgf at max}{\pgf at max}}%
+    \advance\pgf at xa by \pgf at x%
+    \advance\pgf at ya by \pgf at y%
+    \pgf at sys@bp at correct{\pgf at x}%
+    \pgf at sys@bp at correct{\pgf at y}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgfutil at tempdima=2\pgf at max%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \the\pgfutil at tempdima\space height \the\pgfutil at tempdima}%
+      \special{pdf:put @resources
+      <<
+        /Shading << /Sh << /ShadingType 3
+        /ColorSpace \pgf at shading@device\space
+        /Domain [\pgf at pdfparseddomain]
+        /Coords [\pgf at sys@tonumber{\pgf at xa}
+          \pgf at sys@tonumber{\pgf at ya}
+          \pgf at doma\space \pgf at sys@tonumber{\pgf at x}
+          \pgf at sys@tonumber{\pgf at y}
+          \pgf at domb]
+        /Function \pgf at pdfparsedfunction
+        /Extend [true false] >> >>
+      >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \hbox to\the\pgfutil at tempdima{\vbox to\the\pgfutil at tempdima{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+\def\pgfsys at functionalshading#1#2#3#4{%
+  {%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{#3}%
+    \pgf at xb=\pgf at x%
+    \pgf at yb=\pgf at y%
+    \advance\pgf at x by-\pgf at xa%
+    \advance\pgf at y by-\pgf at ya%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgf at sys@bp at correct{\pgf at xb}%
+    \pgf at sys@bp at correct{\pgf at yb}%
+    \pgf at xc=-\pgf at xa%
+    \pgf at yc=-\pgf at ya%
+    % Now build the function
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:stream @pgfstream\the\pgfsys at objnum\space({#4})
+        <</FunctionType 4 /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+          \pgf at sys@tonumber{\pgf at xb}\space
+          \pgf at sys@tonumber{\pgf at ya}\space
+          \pgf at sys@tonumber{\pgf at yb}]
+        /Range [\pgf at shading@functional at range]>>}}}\@tempa%
+    \edef\@tempa{\noexpand\pgfutil at insertatbegincurrentpagefrombox{%
+      \special{pdf:bxobj @pgfshade\the\pgfsys at objnum\space
+        width \the\pgf at x\space height \the\pgf at y}%
+      \special{pdf:put @resources <</Shading <</Sh <</ShadingType 1
+        /ColorSpace \pgf at shading@device\space
+        /Matrix [1 0 0 1 \pgf at sys@tonumber{\pgf at xc}\space
+          \pgf at sys@tonumber{\pgf at yc}]
+        /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+          \pgf at sys@tonumber{\pgf at xb}\space
+          \pgf at sys@tonumber{\pgf at ya}\space
+          \pgf at sys@tonumber{\pgf at yb}]
+        /Function @pgfstream\the\pgfsys at objnum>> >> >>}%
+      \pgfsys at invoke{/Sh sh}%
+      \special{pdf:exobj}}}\@tempa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\hbox to\the\pgf at x{\vbox to\the\pgf at y{%
+        \vfil\special{pdf:uxobj @pgfshade\the\pgfsys at objnum}}\hfil}}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+  \global\advance\pgfsys at objnum\@ne%
+}
+%% 
+%%
+%% End of file `pgfsys-cmykshadings-dvipdfmx.def'.


Property changes on: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-dvipdfmx.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-luatex.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-luatex.def	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,169 @@
+%%
+%% This is file `pgfsys-cmykshadings-luatex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pgf-cmykshadings.dtx  (with options: `luatex-driver')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+%% 
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c 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
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work is "maintained" (as per the LPPL maintenance status)
+%% by David Purton.
+%% 
+%% This work consists of the files pgf-cmykshadings.ins,
+%% pgf-cmykshadings.dtx, README.md, and the derived files
+%%   - pgf-cmykshadings.sty
+%%   - pgfsys-cmykshadings-pdftex.def
+%%   - pgfsys-cmykshadgins-xetex.def
+%%   - pgfsys-cmykshadings-luatex.def
+%%   - pgfsys-cmykshadings-dvipdfmx.def
+%%   - pgf-cmykshadings.pdf
+%% 
+%% 
+%% Substantial parts of the code for this package are taken from the pgf
+%% package files pgfcoreshade.code.tex, pgfsys-pdftex.def,
+%% pgfsys-luatex.def, and pgfsys-dvipdfmx.def copyright (c) 2006 Till
+%% Tantau and then slightly modified to support CMYK and grayscale
+%% shadings.
+%% 
+\ProvidesFile{pgfsys-cmykshadings-luatex.def}%
+  [2018/10/17 CMYK shadings support for PGF luatex driver (DCP)]
+\def\pgfsys at horishading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at max{%
+      \vbox to\pgfmathresult pt{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \immediate\saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at doma\space0 \pgf at domb\space0]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\useboxresource\the\lastsavedboxresourceindex}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at vertshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgfmathresult pt{%
+      \vbox to\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{#2}{\pgf at max}}%
+    \immediate\saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [0 \pgf at doma\space0 \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\useboxresource\the\lastsavedboxresourceindex}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at radialshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \setbox\pgfutil at tempboxa=\hbox to2\pgf at max{%
+      \vbox to2\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{\pgfpoint{\pgf at max}{\pgf at max}}%
+    \advance\pgf at xa by \pgf at x%
+    \advance\pgf at ya by \pgf at y%
+    \pgf at sys@bp at correct{\pgf at x}%
+    \pgf at sys@bp at correct{\pgf at y}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \immediate\saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 3
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at sys@tonumber{\pgf at xa}
+        \pgf at sys@tonumber{\pgf at ya}
+        \pgf at doma\space
+        \pgf at sys@tonumber{\pgf at x}
+        \pgf at sys@tonumber{\pgf at y}
+        \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [true false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\useboxresource\the\lastsavedboxresourceindex}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at functionalshading#1#2#3#4{%
+  {%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{#3}%
+    \pgf at xb=\pgf at x%
+    \pgf at yb=\pgf at y%
+    \advance\pgf at x by-\pgf at xa%
+    \advance\pgf at y by-\pgf at ya%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at x{%
+      \vbox to\pgf at y{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgf at sys@bp at correct{\pgf at xb}%
+    \pgf at sys@bp at correct{\pgf at yb}%
+    \pgf at xc=-\pgf at xa%
+    \pgf at yc=-\pgf at ya%
+    % Now build the function
+    \pdfextension obj
+    stream
+    attr
+    {
+      /FunctionType 4
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Range [\pgf at shading@functional at range]
+    }
+    {{#4}}%
+    \edef\pgf at temp@num{\the\numexpr\pdffeedback lastobj\relax}%
+    \saveboxresource resources {%
+      /Shading << /Sh << /ShadingType 1
+      /ColorSpace \pgf at shading@device\space
+      /Matrix [1 0 0 1 \pgf at sys@tonumber{\pgf at xc}\space
+        \pgf at sys@tonumber{\pgf at yc}]
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Function \pgf at temp@num\space 0 R
+      >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode%
+      \noexpand\useboxresource\the\lastsavedboxresourceindex%
+      \noexpand\pdfextension refobj \pgf at temp@num%
+    }%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+%% 
+%%
+%% End of file `pgfsys-cmykshadings-luatex.def'.


Property changes on: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-luatex.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-pdftex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-pdftex.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-pdftex.def	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,169 @@
+%%
+%% This is file `pgfsys-cmykshadings-pdftex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pgf-cmykshadings.dtx  (with options: `pdftex-driver')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+%% 
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c 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
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work is "maintained" (as per the LPPL maintenance status)
+%% by David Purton.
+%% 
+%% This work consists of the files pgf-cmykshadings.ins,
+%% pgf-cmykshadings.dtx, README.md, and the derived files
+%%   - pgf-cmykshadings.sty
+%%   - pgfsys-cmykshadings-pdftex.def
+%%   - pgfsys-cmykshadgins-xetex.def
+%%   - pgfsys-cmykshadings-luatex.def
+%%   - pgfsys-cmykshadings-dvipdfmx.def
+%%   - pgf-cmykshadings.pdf
+%% 
+%% 
+%% Substantial parts of the code for this package are taken from the pgf
+%% package files pgfcoreshade.code.tex, pgfsys-pdftex.def,
+%% pgfsys-luatex.def, and pgfsys-dvipdfmx.def copyright (c) 2006 Till
+%% Tantau and then slightly modified to support CMYK and grayscale
+%% shadings.
+%% 
+\ProvidesFile{pgfsys-cmykshadings-pdftex.def}%
+  [2018/10/17 CMYK shadings support for PGF pdftex driver (DCP)]
+\def\pgfsys at horishading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at max{%
+      \vbox to\pgfmathresult pt{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{\pgf at max}{#2}}%
+    \immediate\pdfxform resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at doma\space0 \pgf at domb\space0]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\pdfrefxform\the\pdflastxform}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at vertshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \pgfmathparse{#2}%
+    \setbox\pgfutil at tempboxa=\hbox to\pgfmathresult pt{%
+      \vbox to\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{\pgfpoint{#2}{\pgf at max}}%
+    \immediate\pdfxform resources {%
+      /Shading << /Sh << /ShadingType 2
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [0 \pgf at doma\space0 \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [false false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\pdfrefxform\the\pdflastxform}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at radialshading#1#2#3{%
+  {%
+    \pgf at parsefunc{#3}%
+    \setbox\pgfutil at tempboxa=\hbox to2\pgf at max{%
+      \vbox to2\pgf at max{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{\pgfpoint{\pgf at max}{\pgf at max}}%
+    \advance\pgf at xa by \pgf at x%
+    \advance\pgf at ya by \pgf at y%
+    \pgf at sys@bp at correct{\pgf at x}%
+    \pgf at sys@bp at correct{\pgf at y}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \immediate\pdfxform resources {%
+      /Shading << /Sh << /ShadingType 3
+      /ColorSpace \pgf at shading@device\space
+      /Domain [\pgf at pdfparseddomain]
+      /Coords [\pgf at sys@tonumber{\pgf at xa}
+        \pgf at sys@tonumber{\pgf at ya}
+        \pgf at doma\space
+        \pgf at sys@tonumber{\pgf at x}
+        \pgf at sys@tonumber{\pgf at y}
+        \pgf at domb]
+      /Function \pgf at pdfparsedfunction
+      /Extend [true false] >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode\noexpand\pdfrefxform\the\pdflastxform}%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+\def\pgfsys at functionalshading#1#2#3#4{%
+  {%
+    \pgf at process{#2}%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \pgf at process{#3}%
+    \pgf at xb=\pgf at x%
+    \pgf at yb=\pgf at y%
+    \advance\pgf at x by-\pgf at xa%
+    \advance\pgf at y by-\pgf at ya%
+    \setbox\pgfutil at tempboxa=\hbox to\pgf at x{%
+      \vbox to\pgf at y{\vfil\pgfsys at invoke{/Sh sh}}\hfil}%
+    \pgf at sys@bp at correct{\pgf at xa}%
+    \pgf at sys@bp at correct{\pgf at ya}%
+    \pgf at sys@bp at correct{\pgf at xb}%
+    \pgf at sys@bp at correct{\pgf at yb}%
+    \pgf at xc=-\pgf at xa%
+    \pgf at yc=-\pgf at ya%
+    % Now build the function
+    \pdfobj
+    stream
+    attr
+    {
+      /FunctionType 4
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Range [\pgf at shading@functional at range]
+    }
+    {{#4}}%
+    \edef\pgf at temp@num{\the\pdflastobj}%
+    \pdfxform resources {%
+      /Shading << /Sh << /ShadingType 1
+      /ColorSpace \pgf at shading@device\space
+      /Matrix [1 0 0 1 \pgf at sys@tonumber{\pgf at xc}\space
+        \pgf at sys@tonumber{\pgf at yc}]
+      /Domain [\pgf at sys@tonumber{\pgf at xa}\space
+        \pgf at sys@tonumber{\pgf at xb}\space
+        \pgf at sys@tonumber{\pgf at ya}\space
+        \pgf at sys@tonumber{\pgf at yb}]
+      /Function \pgf at temp@num\space 0 R
+      >> >>}\pgfutil at tempboxa% <<
+    \expandafter\xdef\csname @pgfshading#1!\endcsname{%
+      \leavevmode%
+      \noexpand\pdfrefxform\the\pdflastxform%
+      \noexpand\pdfrefobj\pgf at temp@num%
+    }%
+    \expandafter\xdef\csname @pgfshading#1 at model!\endcsname{%
+      \pgf at shading@model}%
+  }%
+}
+%% 
+%%
+%% End of file `pgfsys-cmykshadings-pdftex.def'.


Property changes on: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-pdftex.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-xetex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-xetex.def	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-xetex.def	2018-10-17 20:39:38 UTC (rev 48924)
@@ -0,0 +1,45 @@
+%%
+%% This is file `pgfsys-cmykshadings-xetex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pgf-cmykshadings.dtx  (with options: `xetex-driver')
+%% 
+%% This is a generated file.
+%% 
+%% Copyright (c) 2018 David Purton <dcpurton at marshwiggle.net>
+%% 
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c 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
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work is "maintained" (as per the LPPL maintenance status)
+%% by David Purton.
+%% 
+%% This work consists of the files pgf-cmykshadings.ins,
+%% pgf-cmykshadings.dtx, README.md, and the derived files
+%%   - pgf-cmykshadings.sty
+%%   - pgfsys-cmykshadings-pdftex.def
+%%   - pgfsys-cmykshadgins-xetex.def
+%%   - pgfsys-cmykshadings-luatex.def
+%%   - pgfsys-cmykshadings-dvipdfmx.def
+%%   - pgf-cmykshadings.pdf
+%% 
+%% 
+%% Substantial parts of the code for this package are taken from the pgf
+%% package files pgfcoreshade.code.tex, pgfsys-pdftex.def,
+%% pgfsys-luatex.def, and pgfsys-dvipdfmx.def copyright (c) 2006 Till
+%% Tantau and then slightly modified to support CMYK and grayscale
+%% shadings.
+%% 
+\ProvidesFile{pgfsys-cmykshadings-xetex.def}%
+  [2018/10/17 CMYK shadings support for PGF xetex driver (DCP)]
+\input pgfsys-cmykshadings-dvipdfmx.def
+%% 
+%%
+%% End of file `pgfsys-cmykshadings-xetex.def'.


Property changes on: trunk/Master/texmf-dist/tex/latex/pgf-cmykshadings/pgfsys-cmykshadings-xetex.def
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2018-10-17 00:23:04 UTC (rev 48923)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2018-10-17 20:39:38 UTC (rev 48924)
@@ -500,7 +500,7 @@
     pecha pedigree-perl penrose perception perfectcut perltex
     permute persian-bib
     petiteannonce petri-nets pfarrei
-    pgf pgf-blur pgf-soroban pgf-spectra pgf-umlcd pgf-umlsd
+    pgf pgf-blur pgf-cmykshadings pgf-soroban pgf-spectra pgf-umlcd pgf-umlsd
     pgfgantt pgfkeyx pgfmolbio
     pgfopts pgfornament pgfornament-han pgfplots
     phaistos phffullpagefigure phfnote phfparen phfqit phfquotetext

Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2018-10-17 00:23:04 UTC (rev 48923)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2018-10-17 20:39:38 UTC (rev 48924)
@@ -90,6 +90,7 @@
 depend petri-nets
 depend pgf
 depend pgf-blur
+depend pgf-cmykshadings
 depend pgf-soroban
 depend pgf-spectra
 depend pgf-umlcd

Added: trunk/Master/tlpkg/tlpsrc/pgf-cmykshadings.tlpsrc
===================================================================


More information about the tex-live-commits mailing list