summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/spotcolor
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-05-29 22:35:46 +0000
committerKarl Berry <karl@freefriends.org>2006-05-29 22:35:46 +0000
commit416c5bb3d67a0b20fc2d549e1e9b68e4340ae8a9 (patch)
tree40a23de1eed0deb0b67221cb6e86048a3a8b580c /Master/texmf-dist/tex/latex/spotcolor
parent16bb8f1a9576e181d839577a8c484d6546dfd742 (diff)
new latex package spotcolor
git-svn-id: svn://tug.org/texlive/trunk@1616 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/spotcolor')
-rw-r--r--Master/texmf-dist/tex/latex/spotcolor/spotcolor.sty66
1 files changed, 66 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/spotcolor/spotcolor.sty b/Master/texmf-dist/tex/latex/spotcolor/spotcolor.sty
new file mode 100644
index 00000000000..3fc275b0e3b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/spotcolor/spotcolor.sty
@@ -0,0 +1,66 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{spotcolor}
+ [2006/05/26 v1.0 Package for adding Spot Color support to pdfLaTeX.]
+
+\newif\ifhks\hksfalse
+\newif\ifpantone\pantonefalse
+\DeclareOption{hks}{\hkstrue} % preload hks color values into "hks" colorspace
+\DeclareOption{pantone}{\pantonetrue} % preload pantone color values into "pantone" colorspace
+\ProcessOptions
+
+\RequirePackage[pdftex]{graphics}
+%\RequirePackage{color}
+
+%
+% Erzeugt neuen Colorspace
+%
+\newcommand\NewSpotColorSpace[1]{%
+ \expandafter\newtoks\csname #1\endcsname%
+ \csname #1\endcsname{}%
+}
+
+%
+% Colorspace variable, color name, CMYK representation
+% Adds a new spot color with the CMYK representation in the 2nd parameter (HEX with values from 00-FF)
+%
+\catcode`\#=12%
+\def\SpotSpace{#20}
+\catcode`\#=6%
+\gdef\csgrab#1#2{#2\expandafter{\the#2 #1}}%
+\newcount{\thecolorprofile}
+\newcount{\thecolor}
+\newcommand\AddSpotColor[4]{%
+ \def\obj{ 0 R}%
+ \pdfobj{<</C0[0 0 0 0]/FunctionType 2/C1[#4]/Domain[0 1]/N 1>>}%
+ \thecolorprofile=\the\pdflastobj%
+ \pdfobj{[/Separation/#3 /DeviceCMYK \the\thecolorprofile \obj]}% output color space Info
+ \thecolor=\the\pdflastobj%
+ \edef\tempcs{/#2 \the\pdflastobj \obj}%
+ \expandafter\csgrab\expandafter{\tempcs}{\csname #1\endcsname}%
+ \pdfrefobj\thecolorprofile%
+ \pdfrefobj\thecolor%
+}%
+
+%
+% Sets a color space for the current page
+%
+\def\SetPageColorResource#1{\pdfpageresources{/ColorSpace<<#1>>}}
+\newcommand\SetPageColorSpace[1]{%
+ \expandafter\SetPageColorResource\expandafter{\the\csname #1\endcsname}%
+}%
+
+%
+% Sets the spot color
+%
+\def\SpotColor#1#2{%
+ \pdfliteral{/#1 cs}%
+ \pdfliteral{/#1 CS}%
+ \pdfliteral{#2 sc}%
+ \pdfliteral{#2 SC}%
+}%
+
+%
+% If pantone or hks option specified then load corresponding color tables
+%
+\ifhks\input{spotcolorhks}\fi
+\ifpantone\input{spotcolorpantone}\fi