[latex3-commits] [git/LaTeX3-latex3-xcolor] testl3color: define also l3colors (0cdc068)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Aug 15 16:36:23 CEST 2022


Repository : https://github.com/latex3/xcolor
On branch  : testl3color
Link       : https://github.com/latex3/xcolor/commit/0cdc068bd50f0325bb35cb130127ae0d49057d55

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

commit 0cdc068bd50f0325bb35cb130127ae0d49057d55
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Aug 15 16:36:23 2022 +0200

    define also l3colors


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

0cdc068bd50f0325bb35cb130127ae0d49057d55
 xcolor.dtx | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/xcolor.dtx b/xcolor.dtx
index ed72f48..ed528b9 100644
--- a/xcolor.dtx
+++ b/xcolor.dtx
@@ -4823,7 +4823,21 @@
 %
 %
 % \subsubsection{Colors}\label{sec.definition}
-%
+% \begin{macro}{\XC at expl@color at set@@nnn}
+% \begin{macro}{\XC at expl@color at set@@nn}
+% We want to define colors also for l3color.
+%    \begin{macrocode}
+\ExplSyntaxOn
+\cs_set_eq:NN \XC at expl@color at set@@nnn \color_set:nnn
+\cs_set_eq:NN \XC at expl@color at set@@nn \color_set:nn
+\ExplSyntaxOff
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% We have to suppress the pdfresources patch
+%    \begin{macrocode}
+\disable at package@load{xcolor-patches-tmp-ltx}{}
+%    \end{macrocode}
 % \begin{macro}{\definecolor}
 %   \oarg{type}\marg{name}\oarg{prefix}\marg{model-list}\marg{spec-list}\\
 % Extends the facilities of \LC's |\definecolor|.
@@ -4843,12 +4857,10 @@
 \def\XC at definecolor[#1]#2%
  {\@testopt{\XC at definec@lor[#1]{#2}}\colornameprefix}
 %    \end{macrocode}
-% |\@expl at xcolor@set@@nonn| prepares color for the l3color support.
+%
 %    \begin{macrocode}
-\providecommand\@expl at xcolor@set@@nonn[4]{}
 \def\XC at definec@lor[#1]#2[#3]#4#5%
- {\@expl at xcolor@set@@nonn{#2}{#4}{#5}{#1}%
-  \begingroup
+ {\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}%
@@ -4888,13 +4900,15 @@
       \fi
 %    \end{macrocode}
 %
-% Finally write all information into macro |\\color@|\Meta{name}:
+% Finally write all information into macro |\\color@|\Meta{name}
+% and setup the l3color:
 %    \begin{macrocode}
       \toks@\expandafter{\@@drv}%
       \edef\@@tmp
        {\ifglobalcolors\global\else\xglobal@\fi
         \noexpand\@namedef{\@backslashchar color@\@@nam}%
-         {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}}%
+         {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}%
+        \noexpand\XC at expl@color at set@@nnn{\@@nam}{\@@mod}{\@@clr}}%
     \fi}%
   \expandafter\endgroup\@@tmp\xglobal at stop}
 %    \end{macrocode}
@@ -5015,16 +5029,11 @@
 %    \begin{macrocode}
 \def\colorlet{\@testopt{\XC at colorlet}{}}
 %    \end{macrocode}
-% |\@expl at xcolor@set@@ne| prepares colors also for l3color.
-% As the old patch defined it with |\cs_new| we have to undefine it again temporarly.
+%
 %    \begin{macrocode}
-\IfDocumentMetadataTF
- {\@ifundefined{@expl at xcolor@set@@ne}{\AtEndOfPackage{\let\@expl at xcolor@set@@ne\undefined}{}}{}}
- {}
-\providecommand\@expl at xcolor@set@@ne[2]{}
 \def\XC at colorlet[#1]#2{\@testopt{\XC at col@rlet[#1]{#2}}{}}
 \def\XC at col@rlet[#1]#2[#3]#4%
- {\@expl at xcolor@set@@ne{#2}{#4}%
+ {%
   \begingroup
   \edef\@@cls{#1}\XC at edef\@@nam{#2}\XC at sdef\@@mod{#3}\XC at edef\@@clr{#4}%
 %    \end{macrocode}
@@ -5060,7 +5069,8 @@
    {\c at lor@error{`#2'}\let\@@tmp\@empty}%
    {\edef\@@tmp
      {\ifglobalcolors\global\else\xglobal@\fi
-      \noexpand\XC at let@cc{\@backslashchar color@#1}{\@backslashchar color@#2}}}}
+      \noexpand\XC at let@cc{\@backslashchar color@#1}{\@backslashchar color@#2}%
+      \noexpand\XC at expl@color at set@@nn{#1}{#2}}}}
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list.