diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def index 202778f5802..22c2a291417 100644 --- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def +++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def @@ -1,4 +1,4 @@ -% Copyright 2006, 2011 by Till Tantau +% Copyright 2006 by Till Tantau % % This file may be distributed and/or modified % @@ -8,6 +8,7 @@ % See the file doc/generic/pgf/licenses/LICENSE for more details. +\pgfutil@format@is@contexttrue % The aux files, needed for reading back coordinates @@ -16,6 +17,7 @@ \csname newwrite\endcsname\pgfutil@auxout \csname openout\endcsname\pgfutil@auxout\jobname.pgf } +\def\pgfutil@writetoaux#1{\write\pgfutil@auxout{#1}} % XColor-like support for ConTeXt @@ -138,23 +140,30 @@ \def\pgfutil@emu@select#1#2#3#4#5{#5} - +% The cmyk part is from Joseph Wright. +% See tex.stackexchange.com/questions/27952/cmyk-context-colors-in-tikz \def\pgfutil@registercolor#1{% \edef\pgf@temp{\PDFcolor{#1}}% - \edef\pgf@marshal{\noexpand\pgfutil@in@{ g}{\pgf@temp}}% - \pgf@marshal% - \ifpgfutil@in@% - \expandafter\pgfutil@context@parse@gray\pgf@temp\pgf@stop{#1}% - \else% - \edef\pgf@marshal{\noexpand\pgfutil@in@{ rg}{\pgf@temp}}% - \pgf@marshal% - \ifpgfutil@in@% - \expandafter\pgfutil@context@parse@rgb\pgf@temp\pgf@stop{#1}% - \else% - \PackageError{pgf}{Color #1 has an unsupported color model.}{}% - \pgfutil@definecolor{#1}{gray}{0} - \fi% - \fi% + \edef\pgf@marshal{\noexpand\pgfutil@in@{rg}{\pgf@temp}}% + \pgf@marshal + \ifpgfutil@in@ + \expandafter\pgfutil@context@parse@rgb\pgf@temp\pgf@stop{#1}% + \else + \edef\pgf@marshal{\noexpand\pgfutil@in@{g}{\pgf@temp}}% + \pgf@marshal + \ifpgfutil@in@ + \expandafter\pgfutil@context@parse@gray\pgf@temp\pgf@stop{#1}% + \else + \edef\pgf@marshal{\noexpand\pgfutil@in@{k}{\pgf@temp}}% + \pgf@marshal + \ifpgfutil@in@ + \expandafter\pgfutil@context@parse@cmyk\pgf@temp\pgf@stop{#1}% + \else + \pgferror{Color #1 has an unsupported color model.}% + \pgfutil@definecolor{#1}{gray}{0}% + \fi + \fi + \fi } \def\pgfutil@context@parse@gray#1 g#2\pgf@stop#3{% @@ -165,6 +174,15 @@ \pgfutil@definecolor{#5}{rgb}{#1,#2,#3} } +\def\pgfutil@context@parse@cmyk#1 #2 #3 #4k#5\pgf@stop #6{% + \pgfutil@definecolor{#6}{cmyk}{#1,#2,#3,#4}% +} + +\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{% + \expandafter\def\csname\string\color@#1\endcsname + {\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}% +} + % Make this command available in general: \let\colorlet=\pgfutil@colorlet @@ -253,12 +271,18 @@ \newbox\pgfutil@tempboxa -\newdimen\pgfutil@tempdima -\newdimen\pgfutil@tempdimb - \newbox \pgfutil@voidb@x \newtoks \pgfutil@toks@ +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempdima\pgfutil@tempdima +\let\pgfmath@tempcnta\pgfutil@tempcnta +\let\pgfmath@tempcntb\pgfutil@tempcntb + +% From LaTeX +\newskip\pgfutil@flushglue +\pgfutil@flushglue=0pt plus 1fil + % Module stuff \def\pgfutil@usemodule#1{\usemodule[#1]} @@ -332,9 +356,9 @@ % The following is still messy and needs to be cleanup up (everything % prefixed by pgfutil@): -\def\PackageInfo#1#2{} -\def\PackageWarning#1#2{\immediate\write17{Package #1: Warning! #2.}}% -\def\PackageError#1#2#3{\immediate\write17{Package #1: Error! #2.}}% +%\def\PackageInfo#1#2{} +%\def\PackageWarning#1#2{\immediate\write17{Package #1: Warning! #2.}}% +%\def\PackageError#1#2#3{\immediate\write17{Package #1: Error! #2.}}% \long\def\AtBeginDocument#1{#1}% \endinput |