[latex3-commits] [git/LaTeX3-latex3-latex3] color-export: Combine color export setup using a common auxiliary (f2ba69ea3)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Mar 19 14:07:13 CET 2021


Repository : https://github.com/latex3/latex3
On branch  : color-export
Link       : https://github.com/latex3/latex3/commit/f2ba69ea3b69b06a2e3881046d794fd3889ea7c8

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

commit f2ba69ea3b69b06a2e3881046d794fd3889ea7c8
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Mar 19 13:07:13 2021 +0000

    Combine color export setup using a common auxiliary


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

f2ba69ea3b69b06a2e3881046d794fd3889ea7c8
 l3kernel/l3color.dtx | 57 ++++++++++++++++++++++++----------------------------
 1 file changed, 26 insertions(+), 31 deletions(-)

diff --git a/l3kernel/l3color.dtx b/l3kernel/l3color.dtx
index 52fac6138..5e5ac0937 100644
--- a/l3kernel/l3color.dtx
+++ b/l3kernel/l3color.dtx
@@ -1574,19 +1574,34 @@
 % \end{variable}
 %
 % \begin{macro}
-%   {\@@_export_format_comma-sep-cmyk:nnN, \@@_export_format_space-sep-cmyk:nnN}
+%   {
+%     \@@_export_format_comma-sep-cmyk:nnN ,
+%     \@@_export_format_comma-sep-rgb:nnN  ,
+%     \@@_export_format_space-sep-cmyk:nnN ,
+%     \@@_export_format_space-sep-rgb:nnN
+%   }
+%    \begin{macrocode}
+\group_begin:
+  \cs_set_protected:Npn \@@_tmp:w #1#2
+    {
+      \cs_new_protected:cpx { @@_export_format_ #1 :nnN } ##1##2##3
+        {
+          \exp_not:N \@@_export:nnnNN {#2} {##1} {##2} ##3
+            \exp_not:c { @@_export_ #1 :Nw }
+        }
+    }
+  \@@_tmp:w { comma-sep-cmyk } { cmyk }
+  \@@_tmp:w { comma-sep-rgb }  { rgb }
+  \@@_tmp:w { HTML }           { rgb }
+  \@@_tmp:w { space-sep-cmyk } { cmyk }
+  \@@_tmp:w { space-sep-rgb }  { rgb }
+
+\group_end:
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\@@_export_space-sep-cmyk:Nw, \@@_export_comma-sep-cmyk:Nw}
 %    \begin{macrocode}
-\cs_new_protected:cpx { @@_export_format_comma-sep-cmyk:nnN } #1#2#3
-  {
-    \exp_not:N \@@_export:nnnNN { cmyk } {#1} {#2} #3
-      \exp_not:c { @@_export_comma-sep-cmyk:Nw }
-  }
-\cs_new_protected:cpx { @@_export_format_space-sep-cmyk:nnN } #1#2#3
-  {
-    \exp_not:N \@@_export:nnnNN { cmyk } {#1} {#2} #3
-      \exp_not:c { @@_export_space-sep-cmyk:Nw }
-  }
 \cs_new_protected:cpn { @@_export_comma-sep-cmyk:Nw }
   #1#2 ~ #3 ~ #4 ~ #5 \s_@@_stop
   { \tl_set:Nn #1 { #2 , #3 , #4 , #5 } }
@@ -1594,16 +1609,9 @@
   { \tl_set:Nn #1 {#2} }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 % \begin{macro}
 %   {
-%     \@@_export_format_comma-sep-rgb:nnN ,
-%     \@@_export_format_HTML:nnN          ,
-%     \@@_export_format_space-sep-rgb:nnN
-%   }
-% \begin{macro}
-%   {
 %     \@@_export_comma-sep-rgb:Nw ,
 %     \@@_export_HTML:Nw          ,
 %     \@@_export_space-sep-rgb:Nw
@@ -1612,18 +1620,6 @@
 %   \textsc{html} values must be given in |rgb|: we force conversion if
 %   required, then do some simple maths.
 %    \begin{macrocode}
-\cs_new_protected:cpx { @@_export_format_comma-sep-rgb:nnN } #1#2#3
-  {
-    \exp_not:N \@@_export:nnnNN { rgb } {#1} {#2} #3
-      \exp_not:c { @@_export_comma-sep-rgb:Nw }
-  }
-\cs_new_protected:Npn \@@_export_format_HTML:nnN #1#2#3
-  { \@@_export:nnnNN { rgb } {#1} {#2}#3 \@@_export_HTML:Nw }
-\cs_new_protected:cpx { @@_export_format_space-sep-rgb:nnN } #1#2#3
-  {
-    \exp_not:N \@@_export:nnnNN { rgb } {#1} {#2} #3
-      \exp_not:c { @@_export_space-sep-rgb:Nw }
-  }
 \cs_new_protected:cpn { @@_export_comma-sep-rgb:Nw } #1#2 ~ #3 ~ #4 \s_@@_stop
   { \tl_set:Nx #1 { #2 , #3 , #4 } }
 \cs_new_protected:Npn \@@_export_HTML:Nw #1#2 ~ #3 ~ #4 \s_@@_stop
@@ -1646,7 +1642,6 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 % \subsection{Additional color models}
 %





More information about the latex3-commits mailing list.