[latex3-commits] [git/LaTeX3-latex3-xcolor] testl3color: switch set at color (382bcd5)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Aug 16 17:31:13 CEST 2022


Repository : https://github.com/latex3/xcolor
On branch  : testl3color
Link       : https://github.com/latex3/xcolor/commit/382bcd50f36e1b8e4ae906c23d74785e85f8ff24

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

commit 382bcd50f36e1b8e4ae906c23d74785e85f8ff24
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Aug 16 17:31:13 2022 +0200

    switch set at color


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

382bcd50f36e1b8e4ae906c23d74785e85f8ff24
 xcolor.dtx | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/xcolor.dtx b/xcolor.dtx
index 127da71..316c73f 100644
--- a/xcolor.dtx
+++ b/xcolor.dtx
@@ -5383,7 +5383,34 @@
 % \subsection{Color application}
 %
 % \subsubsection{Standard color commands}
-%
+%  \begin{macro}{\set at color}
+%  |\set at color| is redefined to use the l3color command if possible.
+%    \begin{macrocode}
+\let\XC at ori@set at color\set at color
+\ExplSyntaxOn
+\cs_new_protected:Npn \XC at set@color #1#2#3#4#5
+ {
+  \tl_if_eq:NnTF \current at color {#3}
+    {
+      \str_case:nnF {#4}
+       {
+        {&spot}{ \XC at ori@set at color }
+        { cmy }{ \color_select:nn{cmyk}{#5,0} }
+       }
+       {
+         \color_select:nn{#4}{#5}
+       }
+    }
+    {
+      %for package like crop that sets \current at color manually
+      \PackageWarning{xcolor}{color~differences~detected}{}
+      \XC at ori@set at color
+    }
+ }
+\ExplSyntaxOff
+\def\set at color{\expandafter\XC at set@color\XC at current@color}
+%    \end{macrocode}
+%  \end{macro}
 %  \begin{macro}{\color}
 %   \marg{color}\\
 %   \oarg{model-list}\marg{spec-list}\\





More information about the latex3-commits mailing list.