summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/colorspace
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-25 20:46:21 +0000
committerKarl Berry <karl@freefriends.org>2019-03-25 20:46:21 +0000
commit7a0a67d6119154b2c5c7bc1c069a37db8b374f73 (patch)
tree45ca8a1283aa8ae257fc2f0171feaf0ddb520b37 /Master/texmf-dist/tex/latex/colorspace
parente24fc18b90825b817bfd32398da225ec6a73a37e (diff)
colorspace (25mar19)
git-svn-id: svn://tug.org/texlive/trunk@50585 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/colorspace')
-rw-r--r--Master/texmf-dist/tex/latex/colorspace/colorspace.sty92
1 files changed, 57 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/colorspace/colorspace.sty b/Master/texmf-dist/tex/latex/colorspace/colorspace.sty
index 376116409c1..40e2948f3be 100644
--- a/Master/texmf-dist/tex/latex/colorspace/colorspace.sty
+++ b/Master/texmf-dist/tex/latex/colorspace/colorspace.sty
@@ -1,28 +1,13 @@
-% +--------------------------------------------------+
-% | Typeset colorspace.tex to get the documentation. |
-% +--------------------------------------------------+
%
-%% Copyright (C) 2015-2016 Javier Bezos
-%% All Rights Reserved
-%% http://www.texnia.com
-%%
-%% This work may be distributed and/or modified under the conditions
-%% of the LaTeX Project Public License, either version 1.3 of this
-%% license or (at your option) any later version. The latest version
-%% of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2003/12/01 or later.
-%%
-%% This work has the LPPL maintenance status "maintained".
-%%
-%% This Current Maintainer of this work is Javier Bezos.
-%%
-%% This work consists of the files colorspace.tex and colorspace.sty.
-
-\ProvidesPackage{colorspace}
- [2016/10/05 v1.2.0 PDF color spaces (spot colors...) for
- pdftex and luatex]
+% Copyright (C) 2015-2019 Javier Bezos http://www.texnia.com
+%
+% This file may be distributed and/or modified under the conditions of
+% the MIT License. A version can be found at the end of this file.
+%
+% Repository: https://github.com/jbezos/colorspace
+%
+
+\ProvidesPackage{colorspace}[2019/03/25 v1.3 PDF color spaces]
\edef\spc@savedcatcodes{%
\catcode`\noexpand\/=\the\catcode`\/
@@ -49,7 +34,7 @@
\protected\def\spc@Colorstack{\pdfextension colorstack}
\def\spc@Colorstackinit{\pdffeedback colorstackinit}
\fi
-
+
\def\spc@unknown#1#2{%
\@ifundefined{#1}%
{\PackageError{colorspace}{Unknown #2}%
@@ -73,6 +58,9 @@
\XC@sdef\XC@mod@&spot{&spot}
\def\color@&spot#1#2{%
+ \ifx\spc@ir\@undefined
+ \expandafter\spc@getref\current@color\@@
+ \fi
\c@lor@arg{#2}%
\edef#1{\spc@ir\space cs \spc@ir\space CS #2 sc #2 SC}}
\def\XC@clr@&spot@white{0}
@@ -146,7 +134,7 @@
\def\spc@tempd##1,{% comma -> space
\ifx\@empty##1\else##1 \expandafter\spc@tempd\fi}%
\edef\spc@lab@values{\expandafter\spc@tempd\spc@lab@values,\@empty,}}
-
+
\def\spc@defsc@i#1#2#3#4{%
\def\spc@tempc##1 ##2{% Converts spaces to #20
##1%
@@ -183,8 +171,16 @@
\let\spc@elt\relax
\xdef\spc@csall{\spc@csall\spc@elt2{#1}}}
+% The pgf stuff *must* go before \resetpagecolorspace
\AtBeginDocument{%
- \ifx\spc@csall\@empty\else % ie, if spot/iccbased colors
+ \ifx\spc@csall\@empty\else % ie, if spot/iccbased colors only
+ \ifx\pgf@sys@pgf@resource@list@colorspaces\@undefined\else
+ \def\spc@everycs{\pgf@sys@pgf@resource@list@colorspaces}%
+ \edef\spc@tempa{% Remove pgf "static" ColorSpace
+ \noexpand\spc@remcs\the\spc@Pageresources
+ \noexpand\spc@remcs{\pgf@sys@pdf@colrospaces@objnum}}%
+ \spc@tempa
+ \fi
\resetpagecolorspace
\fi}
@@ -204,7 +200,7 @@
\DeclareOption{illuminant=d55}{\spc@illum@obj{0.9568 1 0.9214}}
\DeclareOption{illuminant=d65}{\spc@illum@obj{0.9504 1 1.0888}}
\DeclareOption{illuminant=d75}{\spc@illum@obj{0.9497 1 1.2261}}
-
+
% Page color spaces. The arrays mapping the spot colors to the obj
% refs are saved into the pdf as objects, and then we also save its
% reference for later recovery. Well, \pdfpageresources is not
@@ -218,16 +214,18 @@
\let\spc@currcs\@empty
\let\spc@cs@\@empty
+\let\spc@everycs\@empty
+
\newcommand\pagecolorspace[1]{%
\protected@edef\spc@tempa{{#1}}%
\expandafter\spc@pagecs\spc@tempa}
\def\spc@pagecs#1{%
\ifx\spc@currcs\@empty\else
- \edef\tempa{%
+ \edef\spc@tempa{%
\noexpand\spc@remcs\the\spc@Pageresources
\noexpand\spc@remcs{\spc@currcs}}%
- \tempa
+ \spc@tempa
\fi
\let\spc@tempd\@empty % list with known spaces
\@for\spc@tempa:=#1\do{%
@@ -248,7 +246,7 @@
\fi}%
\spc@csall % Uses \spc@elt
\@ifundefined{spc@cs@\spc@tempc}%
- {\immediate\spc@Obj{<< \spc@tempb>>}%
+ {\immediate\spc@Obj{<< \spc@everycs\space\spc@tempb>>}%
\expandafter\xdef\csname spc@cs@\spc@tempc\endcsname{\the\spc@Lastobj}}%
{}%
\expandafter\let\expandafter\spc@currcs\csname spc@cs@\spc@tempc\endcsname
@@ -534,7 +532,6 @@
/Default\spc@@space\space\the\spc@Lastobj\space 0 R}%
\endgroup}
-
% ==== Overprint/Knokout ====
\DeclareOption{overprint}{\def\spc@op{1}}
@@ -568,9 +565,12 @@
\immediate\spc@Obj{<< /Type /ExtGState /op true /OP true /OPM 1 >>}%
\edef\spc@tempa{\spc@tempa/SPCop \the\spc@Lastobj\space 0 R }%
\immediate\spc@Obj{<< \spc@tempa>>}%
-\edef\spc@tempa{\global\spc@Pageresources{\the\spc@Pageresources
- \space /ExtGState \the\spc@Lastobj\space 0 R }}
-\spc@tempa
+\edef\spc@op@saveobj{\the\spc@Lastobj}
+
+\AtBeginDocument{%
+ \edef\spc@tempa{\global\spc@Pageresources{\the\spc@Pageresources
+ \space /ExtGState \spc@op@saveobj\space 0 R }}%
+ \spc@tempa}
\def\spc@setop{%
\spc@Colorstack\spc@opstack push{\spc@getop}%
@@ -590,3 +590,25 @@
\spc@savedcatcodes
\endinput
+
+MIT License
+-----------
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.