summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/colorspace
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-10-07 22:26:00 +0000
committerKarl Berry <karl@freefriends.org>2016-10-07 22:26:00 +0000
commitcee1cf1fa4bae5836fd774f55d623142edad60e3 (patch)
tree06a019e84906fe08ff0da5495eb5f757dbf9c0a7 /Master/texmf-dist/tex/latex/colorspace
parent94c514933dc47dcba1f868f7df9ae3b131e5503a (diff)
colorspace (6oct16)
git-svn-id: svn://tug.org/texlive/trunk@42228 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/colorspace')
-rw-r--r--Master/texmf-dist/tex/latex/colorspace/colorspace.sty63
1 files changed, 54 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/colorspace/colorspace.sty b/Master/texmf-dist/tex/latex/colorspace/colorspace.sty
index 39e2bf5fb3b..376116409c1 100644
--- a/Master/texmf-dist/tex/latex/colorspace/colorspace.sty
+++ b/Master/texmf-dist/tex/latex/colorspace/colorspace.sty
@@ -21,7 +21,7 @@
%% This work consists of the files colorspace.tex and colorspace.sty.
\ProvidesPackage{colorspace}
- [2016/09/12 v1.1.1 PDF color spaces (spot colors...) for
+ [2016/10/05 v1.2.0 PDF color spaces (spot colors...) for
pdftex and luatex]
\edef\spc@savedcatcodes{%
@@ -49,9 +49,7 @@
\protected\def\spc@Colorstack{\pdfextension colorstack}
\def\spc@Colorstackinit{\pdffeedback colorstackinit}
\fi
-
-%
-
+
\def\spc@unknown#1#2{%
\@ifundefined{#1}%
{\PackageError{colorspace}{Unknown #2}%
@@ -130,6 +128,25 @@
\newcommand\definespotcolor[2]{\protected@edef\spc@tempa{{#1}{#2}}\spc@defsc}
\newcommand\spc@defsc[2][cmyk]{\expandafter\spc@defsc@i\spc@tempa{#1}{#2}}
+
+\def\spc@splitbar#1#2#3/#4\@nil{%
+ \def#1{#3}%
+ \def#2{#4}}
+
+\let\spc@lab@values\relax
+
+\@namedef{spc@opt@alt=lab}#1{%
+ \@expandtwoargs\in@{/}{#1}%
+ \ifin@
+ \spc@splitbar\spc@lab@values\spc@the@cmyk#1\@nil
+ \else
+ \def\spc@lab@values{#1}%
+ \def\spc@the@cmyk{0,0,0,0}% dummy
+ \fi
+ \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%
@@ -145,11 +162,22 @@
{This spot name was taken by `##2'.}%
\fi}
\spc@csall
- \definecolor{#1}{cmyk:#3}{#4}% internally always cmyk
- \expandafter\spc@cmyktospot{#1}\spc@tempb % Convert from cmyk to spot
- \immediate\spc@Obj{[ /Separation /\spc@tempb\space
- /DeviceCMYK << /FunctionType 2 /Domain [0 1]
- /C0 [0 0 0 0] /C1 [\spc@tempa] /N 1 >> ]}% pdf separation
+ \@ifundefined{spc@opt@\zap@space#3 \@empty}%
+ {\definecolor{#1}{cmyk:#3}{#4}}%
+ {\@nameuse{spc@opt@\zap@space#3 \@empty}{#4}%
+ \definecolor{#1}{cmyk}{\spc@the@cmyk}}%
+ \expandafter\spc@cmyktospot{#1}\spc@tempb % Convert cmyk > spot
+ \ifx\spc@lab@values\relax
+ \immediate\spc@Obj{[ /Separation /\spc@tempb\space
+ /DeviceCMYK << /FunctionType 2 /Domain [0 1]
+ /C0 [0 0 0 0] /C1 [\spc@tempa] /N 1 >> ]}% pdf separation
+ \else
+ \immediate\spc@Obj{[ /Separation /\spc@tempb\space
+ \spc@illum@ref << /FunctionType 2 /Domain [0 1]
+ /Range[0 100 -128 127 -128 127]
+ /C0 [100 0 0] /C1 [\spc@lab@values] /N 1 >> ]}% pdf separation
+ \global\let\spc@lab@values\relax
+ \fi
\expandafter\xdef\csname spc@ir@#1\endcsname{%
/&\spc@tempb\space\the\spc@Lastobj\space 0 R}% save ref to obj
\let\spc@elt\relax
@@ -160,6 +188,23 @@
\resetpagecolorspace
\fi}
+% Options for illuminants:
+
+\def\spc@illum@obj#1{%
+ \immediate\spc@Obj{[ /Lab
+ << /WhitePoint [#1] /Range [-128 127 -128 127] >> ]}%
+ \xdef\spc@illum@ref{\the\spc@Lastobj\space 0 R }}
+
+% 1931, 2-degree observer. c is deprecated
+
+\DeclareOption{illuminant=a}{\spc@illum@obj{1.0985 1 0.3558}}
+\DeclareOption{illuminant=c}{\spc@illum@obj{0.9807 1 1.1822}}
+\DeclareOption{illuminant=e}{\spc@illum@obj{1 1 1}}
+\DeclareOption{illuminant=d50}{\spc@illum@obj{0.9642 1 0.8251}}
+\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