summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/oberdiek/hycolor.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/hycolor.sty')
-rw-r--r--Master/texmf-dist/tex/latex/oberdiek/hycolor.sty118
1 files changed, 114 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/hycolor.sty b/Master/texmf-dist/tex/latex/oberdiek/hycolor.sty
index e300089260b..6a57ada8ffa 100644
--- a/Master/texmf-dist/tex/latex/oberdiek/hycolor.sty
+++ b/Master/texmf-dist/tex/latex/oberdiek/hycolor.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de>
+%% Copyright (C) 2007, 2008 by Heiko Oberdiek <oberdiek@uni-freiburg.de>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -25,11 +25,11 @@
%% This work consists of the main source file hycolor.dtx
%% and the derived files
%% hycolor.sty, hycolor.pdf, hycolor.ins, hycolor.drv,
-%% hycolor-test1.tex, hycolor-test2.tex.
+%% hycolor-test1.tex, hycolor-test2.tex, hycolor-test3.tex.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{hycolor}%
- [2007/04/11 v1.1 Code for color options of hyperref/bookmark (HO)]%
+ [2008/07/29 v1.2 Code for color options of hyperref/bookmark (HO)]%
\begingroup
\catcode`\!=13 %
\catcode`\:=13 %
@@ -328,6 +328,7 @@
\fi
\fi
}
+\newif\ifHyColor@result
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname pdfmatch\endcsname\relax
\expandafter\@firstoftwo
@@ -335,7 +336,6 @@
\expandafter\@secondoftwo
\fi
{%
- \newif\ifHyColor@result
\begingroup
\def\x#1{\endgroup
\def\HyColor@IfRGB##1{%
@@ -400,8 +400,10 @@
\expandafter\strip@prefix\pdflastmatch2,%
\expandafter\strip@prefix\pdflastmatch3%
}%
+ \HyColor@resulttrue
\expandafter\@firstoftwo
\else
+ \HyColor@resultfalse
\expandafter\@secondoftwo
\fi
}%
@@ -446,6 +448,114 @@
\fi
}%
}
+\def\HyColor@DetectPdfVersion{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname Hy@pdfversion\endcsname\relax
+ \global\chardef\HyColor@PdfVersion=0 %
+ \else
+ \global\chardef\HyColor@PdfVersion=\Hy@pdfversion\relax
+ \fi
+ \global\let\HyColor@DetectPdfVersion\relax
+}
+\def\HyColor@SpaceToComma#1 #2\@nil{%
+ #1%
+ \ifx\relax#2\relax
+ \expandafter\@gobble
+ \else
+ ,%
+ \expandafter\@firstofone
+ \fi
+ {%
+ \HyColor@SpaceToComma#2\@nil
+ }%
+}%
+\def\HyColor@AttachfileColor#1#2#3#4#5#6{%
+ \def#2{#1}%
+ \ifx#2\@empty
+ \let#3\@gobble
+ \let#4\@empty
+ \else
+ \HyColor@resultfalse
+ \HyColor@XZeroOneThreeFour{#1}#3{#5}{#6}%
+ \ifHyColor@result
+ \edef#2{%
+ [rgb]{\expandafter\HyColor@SpaceToComma#3 \@nil}%
+ }%
+ \fi
+ \ifx\HyColor@model\HyColor@model@rgb
+ \edef#4{/C[#3]}% hash-ok
+ \edef#3##1{%
+ #3 %
+ \noexpand\csname atfi@SETRGBCOLOR##1\noexpand\endcsname
+ }%
+ \else
+ \ifx\HyColor@model\HyColor@model@gray
+ \HyColor@DetectPdfVersion
+ \ifnum\HyColor@PdfVersion<7 %
+ \edef#4{/C[#3 #3 #3]}% hash-ok
+ \else
+ \edef#4{/C[#3]}% hash-ok
+ \fi
+ \edef#3##1{%
+ #3 %
+ \noexpand\csname atfi@SETGRAYCOLOR##1\noexpand\endcsname
+ }%
+ \else
+ \ifx\HyColor@model\HyColor@model@cmyk
+ \HyColor@DetectPdfVersion
+ \ifnum\HyColor@PdfVersion<7 %
+ \HyColor@IfModel{#1}{%
+ \HyColor@IfXcolor{%
+ \convertcolorspec\HyColor@model\HyColor@values
+ \HyColor@model@rgb#4%
+ \expandafter\HyColor@NormalizeCommaRGB#4\@nil#4%
+ \edef#4{/C[#4]}% hash-ok
+ }{%
+ \let#4\@empty
+ \HyColor@ErrorModelNoXcolor{#5}{#6}%
+ }%
+ }{%
+ \HyColor@IfXcolor{%
+ \extractcolorspec{#1}#4%
+ \expandafter\convertcolorspec#4%
+ \HyColor@model@rgb#4%
+ \expandafter\HyColor@NormalizeCommaRGB#4\@nil#4%
+ \edef#4{/C[#4]}% hash-ok
+ }{%
+ \let#4\@empty
+ \HyColor@ErrorSpecNoXcolor{#5}{#6}%
+ }%
+ }%
+ \else
+ \edef#4{/C[#3]}% hash-ok
+ \fi
+ \edef#3##1{%
+ #3 %
+ \noexpand\csname atfi@SETCMYKCOLOR##1\noexpand\endcsname
+ }%
+ \else
+ \ifx\HyColor@model\HyColor@model@empty
+ \PackageError{#5}{%
+ Color model `empty' is not permitted for option `#6'%
+ }\@ehc
+ \let#2\@empty
+ \let#3\@gobble
+ \let#4\@empty
+ \else
+ \ifx\HyColor@model\relax % (missing xcolor)
+ \let#3\@gobble
+ \let#4\@empty
+ \else
+ \PackageError{#5}{%
+ Internal error: unsupported color model%
+ }\@ehc
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
\endinput
%%
%% End of file `hycolor.sty'.