[latex3-commits] [git/LaTeX3-latex3-latex3] color-multi-model: Correct end-of-loop approach when a fixed model applies to color (352f389dd)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Jun 11 09:04:54 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : color-multi-model
Link : https://github.com/latex3/latex3/commit/352f389dd965cac2cac35bf10c285030c68c22f4
>---------------------------------------------------------------
commit 352f389dd965cac2cac35bf10c285030c68c22f4
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Thu Jun 11 08:04:28 2020 +0100
Correct end-of-loop approach when a fixed model applies to color
If there is no hit in the list of colors, we still need to do
std conversion.
>---------------------------------------------------------------
352f389dd965cac2cac35bf10c285030c68c22f4
l3experimental/l3color/l3color.dtx | 12 ++++++------
l3experimental/l3color/testfiles/m3color003.lvt | 8 ++++++++
l3experimental/l3color/testfiles/m3color003.ptex.tlg | 13 +++++++++++++
l3experimental/l3color/testfiles/m3color003.tlg | 12 ++++++++++++
l3experimental/l3color/testfiles/m3color003.uptex.tlg | 13 +++++++++++++
l3experimental/l3color/testfiles/m3color003.xetex.tlg | 12 ++++++++++++
6 files changed, 64 insertions(+), 6 deletions(-)
diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index fb5fed38a..c58f09f25 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -382,8 +382,8 @@
%
% \subsection{Model conversion}
%
-% \begin{macro}{\@@_convert:nnN, \@@_convert:nVN, \@@_convert:VVN}
-% \begin{macro}{\@@_convert:nnnN}
+% \begin{macro}{\@@_convert:nnN, \@@_convert:VVN}
+% \begin{macro}{\@@_convert:nnnN, \@@_convert:nVnN, \@@_convert:nnVN}
% \begin{macro}[aux, EXP]
% {
% \@@_convert_gray_rgb:w
@@ -400,7 +400,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_convert:nnN #1#2#3
{ \@@_convert:nnVN {#1} {#2} #3 #3 }
-\cs_generate_variant:Nn \@@_convert:nnN { nV , VV }
+\cs_generate_variant:Nn \@@_convert:nnN { VV }
\cs_new_protected:Npn \@@_convert:nnnN #1#2#3#4
{
\str_if_eq:nnT {#1} { spot } % TO DO!!!
@@ -408,7 +408,7 @@
\tl_set:Nx #4
{ \use:c { @@_convert_ #1 _ #2 :w } #3 ~ 0 ~ 0 ~ 0 \s_@@_stop }
}
-\cs_generate_variant:Nn \@@_convert:nnnN { nnV }
+\cs_generate_variant:Nn \@@_convert:nnnN { nV , nnV }
\cs_new:Npn \@@_convert_gray_rgb:w #1 ~ #2 \s_@@_stop
{ #1 ~ #1 ~ #1 }
\cs_new:Npn \@@_convert_gray_cmyk:w #1 ~ #2 \s_@@_stop
@@ -916,8 +916,8 @@
}
\cs_new_protected:Npn \@@_select_swap:nn #1#2
{
- \@@_convert:nVN {#1} \l_color_fixed_model_tl \l_@@_value_tl
- \tl_set:Nx #1
+ \@@_convert:nVnN {#1} \l_color_fixed_model_tl {#2} \l_@@_value_tl
+ \tl_set:Nx \l_@@_current_tl
{ { \l_color_fixed_model_tl } { \l_@@_value_tl } }
}
% \end{macrocode}
diff --git a/l3experimental/l3color/testfiles/m3color003.lvt b/l3experimental/l3color/testfiles/m3color003.lvt
index 11b2c6476..a630bd159 100644
--- a/l3experimental/l3color/testfiles/m3color003.lvt
+++ b/l3experimental/l3color/testfiles/m3color003.lvt
@@ -52,6 +52,14 @@
{ 0.1 , 0.2 , 0.3 / 0.1 , 0.2 , 0.3 , 0.4 }
}
\group_end:
+ \group_begin:
+ \tl_set:Nn \l_color_fixed_model_tl { gray }
+ \test:n
+ {
+ \color_select:nn { rgb / cmyk }
+ { 0.1 , 0.2 , 0.3 / 0.1 , 0.2 , 0.3 , 0.4 }
+ }
+ \group_end:
}
\TEST { Multiple~models:~named }
diff --git a/l3experimental/l3color/testfiles/m3color003.ptex.tlg b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
index 633c2697a..27771fd9e 100644
--- a/l3experimental/l3color/testfiles/m3color003.ptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
@@ -56,6 +56,19 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(6.94444+0.0)x22.50005
+.\special{color push gray 0.181}
+.\special{ps:SDict begin /color.fc {} def end}
+.\OT1/cmr/m/n/10 H
+.\OT1/cmr/m/n/10 e
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 o
+.\special{color pop}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 2: Multiple models: named
diff --git a/l3experimental/l3color/testfiles/m3color003.tlg b/l3experimental/l3color/testfiles/m3color003.tlg
index ace362097..30372dd11 100644
--- a/l3experimental/l3color/testfiles/m3color003.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.tlg
@@ -52,6 +52,18 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(6.94444+0.0)x22.50005
+.\pdfcolorstack 0 push {0.181 g 0.181 G}
+.\OT1/cmr/m/n/10 H
+.\OT1/cmr/m/n/10 e
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 o
+.\pdfcolorstack 0 pop
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 2: Multiple models: named
diff --git a/l3experimental/l3color/testfiles/m3color003.uptex.tlg b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
index 633c2697a..27771fd9e 100644
--- a/l3experimental/l3color/testfiles/m3color003.uptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
@@ -56,6 +56,19 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(6.94444+0.0)x22.50005
+.\special{color push gray 0.181}
+.\special{ps:SDict begin /color.fc {} def end}
+.\OT1/cmr/m/n/10 H
+.\OT1/cmr/m/n/10 e
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 o
+.\special{color pop}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 2: Multiple models: named
diff --git a/l3experimental/l3color/testfiles/m3color003.xetex.tlg b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
index c8d85db92..3e2fb25a4 100644
--- a/l3experimental/l3color/testfiles/m3color003.xetex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
@@ -52,6 +52,18 @@ l. ... }
! OK.
<argument> \l_tmpa_box
l. ... }
+> \box...=
+\hbox(6.94444+0.0)x22.50005
+.\special{color push gray 0.181}
+.\OT1/cmr/m/n/10 H
+.\OT1/cmr/m/n/10 e
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 l
+.\OT1/cmr/m/n/10 o
+.\special{color pop}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
============================================================
============================================================
TEST 2: Multiple models: named
More information about the latex3-commits
mailing list.