[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: temporary xcolor patch for l3color use (375f7b9)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Jan 14 00:51:39 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/375f7b94ad26f0bd4cb15d88c1a4a38c2948ddd1

>---------------------------------------------------------------

commit 375f7b94ad26f0bd4cb15d88c1a4a38c2948ddd1
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Jan 14 00:51:39 2021 +0100

    temporary xcolor patch for l3color use


>---------------------------------------------------------------

375f7b94ad26f0bd4cb15d88c1a4a38c2948ddd1
 xcolor-patches-tmp.sty | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/xcolor-patches-tmp.sty b/xcolor-patches-tmp.sty
new file mode 100644
index 0000000..dc212f3
--- /dev/null
+++ b/xcolor-patches-tmp.sty
@@ -0,0 +1,83 @@
+%% LaTeX2e file `xcolor-patches.sty'
+%% generated by the `filecontents' environment
+%% from source `test-utf8' on 2021/01/14.
+%%
+\ProvidesPackage{xcolor-patches-tmp}[2021/01/14 v0.1 patch xcolor for l3color]
+
+\RequirePackage{l3color}
+\ExplSyntaxOn
+ \cs_gset_eq:NN \@expl at color@set@@nnn \color_set:nnn
+ \cs_generate_variant:Nn \color_set:nn {ne}
+ \cs_new_protected:Npn \@expl at color@set@@ne #1 #2
+    {
+      \exp_args:Nx \__color_if_defined:nT {#2}
+           { \color_set:ne {#1}{#2} }
+    }
+\ExplSyntaxOff
+%\pretocmd{\XC at col@rlet}   {\@expl at color@set@@ne{#2}{#4}}{}{\fail}
+\def\XC at col@rlet[#1]#2[#3]#4%
+ {\@expl at color@set@@ne{#2}{#4}%
+  \begingroup
+  \edef\@@cls{#1}\XC at edef\@@nam{#2}\XC at sdef\@@mod{#3}\XC at edef\@@clr{#4}%
+  \XC at info\@@clr\@@tmp\XC@@tstfalse
+  \ifnum\@@tmp=\@ne\ifx\@@mod\@empty
+    \ifx\@@cls\@empty
+      \XC@@tsttrue
+    \else
+      \edef\@@tmp
+       {\expandafter\expandafter\expandafter\@secondoffive
+         \csname\string\color@\@@clr\endcsname}%
+      \ifx\@@cls\@@tmp\XC@@tsttrue\fi
+    \fi
+  \fi\fi
+  \ifXC@@tst
+    \XC at logdef\@@nam\XC at c@l at rlet\@@nam\@@clr
+  \else
+    \extractcolorspec\@@clr\@@clr
+    \ifx\@@mod\@empty\else
+      \expandafter\convertcolorspec\@@clr\@@mod\@@clr
+      \edef\@@clr{{\@@mod}{\@@clr}}\fi
+    \edef\@@tmp{\noexpand\XC at definecolor[\@@cls]{\@@nam}\@@clr}%
+  \fi
+  \expandafter\endgroup\@@tmp\xglobal at stop}
+
+%\pretocmd{\XC at definec@lor}{\@expl at color@set@@nnn{#2}{#4}{#5}}{}{\fail}
+\def\XC at definec@lor[#1]#2[#3]#4#5%
+ {\@expl at color@set@@nnn{#2}{#4}{#5}%
+  \begingroup
+  \XC at sdef\@@cls{#1}\XC at edef\@@nam{#2}\edef\colornameprefix{#3}%
+  \XC at logdef\@@nam
+  \XC at getmodclr02{#4}{#5}{\let\@@tmp\relax}%
+   {\ifx\@@mod\XC at mod@named
+      \XC at c@l at rlet\@@nam\@@clr
+    \else
+      \ifx\@@cls\XC at mod@ps
+        \edef\@@drv{\@@mod\space\@@clr}\def\@@hue{0}%
+        \edef\@@clr{\@nameuse{XC at clr@\@@mod @white}}%
+      \else
+        \ifconvertcolorsD
+          \let\@@tmp\@@mod\XC at sdef\@@mod{\XC at tgt@mod\@@tmp}%
+          \convertcolorspec\@@tmp\@@clr\@@mod\@@clr
+        \fi
+        \XC at coremodel\@@mod\@@clr
+        \csname color@\@@mod\expandafter\endcsname
+          \expandafter\@@drv\expandafter{\@@clr}%
+        \ifcase\XC@@xcp@
+          \immediate\write\XC@@xcp{/\colornameprefix\@@nam{\expandafter
+            \XC at strip@comma\@@clr,,\@nnil}XC\@@mod}%
+          \let\@@cls\XC at mod@named
+        \fi
+        \ifx\@@cls\@empty\else
+          \let\@@tmp\@@cls
+          \@nameuse{define at color@\@@cls}\@@nam\@@drv
+          \csname color@\@@tmp\expandafter\endcsname
+            \expandafter\@@drv\expandafter{\@@nam}%
+        \fi
+      \fi
+      \toks@\expandafter{\@@drv}%
+      \edef\@@tmp
+       {\ifglobalcolors\global\else\xglobal@\fi
+        \noexpand\@namedef{\string\color@\@@nam}%
+         {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}}%
+    \fi}%
+  \expandafter\endgroup\@@tmp\xglobal at stop}





More information about the latex3-commits mailing list.