[latex3-commits] [git/LaTeX3-latex3-latex3] color-multi-model: Correct combination of multiple color models (8c6eb5a5c)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue Jun 30 09:16:13 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : color-multi-model
Link : https://github.com/latex3/latex3/commit/8c6eb5a5cfc1b7a33b5d148f1a3e34ecd95d8d7e
>---------------------------------------------------------------
commit 8c6eb5a5cfc1b7a33b5d148f1a3e34ecd95d8d7e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Jun 30 08:16:13 2020 +0100
Correct combination of multiple color models
>---------------------------------------------------------------
8c6eb5a5cfc1b7a33b5d148f1a3e34ecd95d8d7e
l3experimental/l3color/l3color.dtx | 8 ++++----
l3experimental/l3color/testfiles/m3color003.lvt | 12 +++++++++++
.../l3color/testfiles/m3color003.ptex.tlg | 24 ++++++++++++++++------
l3experimental/l3color/testfiles/m3color003.tlg | 24 ++++++++++++++++------
.../l3color/testfiles/m3color003.uptex.tlg | 24 ++++++++++++++++------
.../l3color/testfiles/m3color003.xetex.tlg | 24 ++++++++++++++++------
6 files changed, 88 insertions(+), 28 deletions(-)
diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index cee80af8b..459f70193 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -1015,7 +1015,7 @@
\prop_clear_new:c { l_@@_named_ #1 _prop }
\prop_put:cvx { l_@@_named_ #1 _prop } { l_@@_named_ #1 _tl }
{ \@@_values:N \l_@@_named_tl }
- \@@_set:nnw {#1} #2 ! \s_@@_stop
+ \@@_set:nnw {#1} {#2} #2 ! \s_@@_stop
}
}
% \end{macrocode}
@@ -1026,16 +1026,16 @@
% any sense here. There is a bit of a performance hit but this should be
% rare and taking place during set-up.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_set:nnw #1#2 ! #3 \s_@@_stop
+\cs_new_protected:Npn \@@_set:nnw #1#2#3 ! #4 \s_@@_stop
{
\clist_map_inline:nn { cmyk , gray , rgb }
{
- \prop_get:cnNT { l_@@_named_ #2 _prop } {##1} \l_@@_internal_tl
+ \prop_get:cnNT { l_@@_named_ #3 _prop } {##1} \l_@@_internal_tl
{
\prop_if_in:cnF { l_@@_named_ #1 _prop } {##1}
{
\group_begin:
- \tl_set:cn { l_@@_named_ #2 _tl } {##1}
+ \tl_set:cn { l_@@_named_ #3 _tl } {##1}
\@@_parse:nN {#2} \l_@@_internal_tl
\exp_args:NNNV \group_end:
\tl_set:Nn \l_@@_internal_tl \l_@@_internal_tl
diff --git a/l3experimental/l3color/testfiles/m3color003.lvt b/l3experimental/l3color/testfiles/m3color003.lvt
index 9c6273649..2325221b3 100644
--- a/l3experimental/l3color/testfiles/m3color003.lvt
+++ b/l3experimental/l3color/testfiles/m3color003.lvt
@@ -74,14 +74,26 @@
\TEST { Mixing~multiple~models }
{
+ \OMIT
\color_set:nnn { myrgbcmyk } { rgb / cmyk }
{ 1 , 0 , 1 / 1 , 0 , 0 , 1 }
\color_set:nnn { mycmykrgb } { cmyk / rgb }
{ 1 , 0 , 0 , 1 / 1 , 0 , 1 }
+ \TIMO
\color_set:nn { myexpr1 } { myrgbcmyk!30!mycmykrgb }
\color_show:n { myexpr1 }
\color_set:nn { myexpr2 } { mycmykrgb!30!myrgbcmyk }
\color_show:n { myexpr2 }
+ \OMIT
+ \color_set:nnn { myA }{ rgb / cmyk }
+ { 0.3 , 0.3 , 0.3 / 0.3 , 0.3 , 0.3 , 0.3 }
+ \color_set:nnn { myB }{ cmyk /rgb }
+ { 0.3 , 0.3 , 0.3 , 0.3 / 0.3 , 0.3 , 0.3 }
+ \TIMO
+ \color_set:nn { myC } { myA!30 }
+ \color_show:n { myC }
+ \color_set:nn { myD } { myB!30 }
+ \color_show:n { myD }
}
\TEST { Exporting~multiple~models }
diff --git a/l3experimental/l3color/testfiles/m3color003.ptex.tlg b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
index 8ac01fe6c..4c89c4bae 100644
--- a/l3experimental/l3color/testfiles/m3color003.ptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
@@ -91,16 +91,12 @@ l. ... }
============================================================
TEST 3: Mixing multiple models
============================================================
-Defining \l__color_named_myrgbcmyk_tl on line ...
-Defining \l__color_named_myrgbcmyk_prop on line ...
-Defining \l__color_named_mycmykrgb_tl on line ...
-Defining \l__color_named_mycmykrgb_prop on line ...
Defining \l__color_named_myexpr1_tl on line ...
Defining \l__color_named_myexpr1_prop on line ...
The color myexpr1 has the properties:
> model => rgb
> rgb => 1 0 1
-> cmyk => 1.0 0.0 0.0 1.0.
+> cmyk => 1 0 0 1.
<recently read> }
l. ... }
Defining \l__color_named_myexpr2_tl on line ...
@@ -108,7 +104,23 @@ Defining \l__color_named_myexpr2_prop on line ...
The color myexpr2 has the properties:
> model => cmyk
> cmyk => 1 0 0 1
-> rgb => 1.0 0.0 1.0.
+> rgb => 1 0 1.
+<recently read> }
+l. ... }
+Defining \l__color_named_myC_tl on line ...
+Defining \l__color_named_myC_prop on line ...
+The color myC has the properties:
+> model => rgb
+> rgb => 0.79 0.79 0.79
+> cmyk => 0.09 0.09 0.09 0.09.
+<recently read> }
+l. ... }
+Defining \l__color_named_myD_tl on line ...
+Defining \l__color_named_myD_prop on line ...
+The color myD has the properties:
+> model => cmyk
+> cmyk => 0.09 0.09 0.09 0.09
+> rgb => 0.79 0.79 0.79.
<recently read> }
l. ... }
============================================================
diff --git a/l3experimental/l3color/testfiles/m3color003.tlg b/l3experimental/l3color/testfiles/m3color003.tlg
index 045f93432..7eb25a0af 100644
--- a/l3experimental/l3color/testfiles/m3color003.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.tlg
@@ -86,16 +86,12 @@ l. ... }
============================================================
TEST 3: Mixing multiple models
============================================================
-Defining \l__color_named_myrgbcmyk_tl on line ...
-Defining \l__color_named_myrgbcmyk_prop on line ...
-Defining \l__color_named_mycmykrgb_tl on line ...
-Defining \l__color_named_mycmykrgb_prop on line ...
Defining \l__color_named_myexpr1_tl on line ...
Defining \l__color_named_myexpr1_prop on line ...
The color myexpr1 has the properties:
> model => rgb
> rgb => 1 0 1
-> cmyk => 1.0 0.0 0.0 1.0.
+> cmyk => 1 0 0 1.
<recently read> }
l. ... }
Defining \l__color_named_myexpr2_tl on line ...
@@ -103,7 +99,23 @@ Defining \l__color_named_myexpr2_prop on line ...
The color myexpr2 has the properties:
> model => cmyk
> cmyk => 1 0 0 1
-> rgb => 1.0 0.0 1.0.
+> rgb => 1 0 1.
+<recently read> }
+l. ... }
+Defining \l__color_named_myC_tl on line ...
+Defining \l__color_named_myC_prop on line ...
+The color myC has the properties:
+> model => rgb
+> rgb => 0.79 0.79 0.79
+> cmyk => 0.09 0.09 0.09 0.09.
+<recently read> }
+l. ... }
+Defining \l__color_named_myD_tl on line ...
+Defining \l__color_named_myD_prop on line ...
+The color myD has the properties:
+> model => cmyk
+> cmyk => 0.09 0.09 0.09 0.09
+> rgb => 0.79 0.79 0.79.
<recently read> }
l. ... }
============================================================
diff --git a/l3experimental/l3color/testfiles/m3color003.uptex.tlg b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
index 8ac01fe6c..4c89c4bae 100644
--- a/l3experimental/l3color/testfiles/m3color003.uptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
@@ -91,16 +91,12 @@ l. ... }
============================================================
TEST 3: Mixing multiple models
============================================================
-Defining \l__color_named_myrgbcmyk_tl on line ...
-Defining \l__color_named_myrgbcmyk_prop on line ...
-Defining \l__color_named_mycmykrgb_tl on line ...
-Defining \l__color_named_mycmykrgb_prop on line ...
Defining \l__color_named_myexpr1_tl on line ...
Defining \l__color_named_myexpr1_prop on line ...
The color myexpr1 has the properties:
> model => rgb
> rgb => 1 0 1
-> cmyk => 1.0 0.0 0.0 1.0.
+> cmyk => 1 0 0 1.
<recently read> }
l. ... }
Defining \l__color_named_myexpr2_tl on line ...
@@ -108,7 +104,23 @@ Defining \l__color_named_myexpr2_prop on line ...
The color myexpr2 has the properties:
> model => cmyk
> cmyk => 1 0 0 1
-> rgb => 1.0 0.0 1.0.
+> rgb => 1 0 1.
+<recently read> }
+l. ... }
+Defining \l__color_named_myC_tl on line ...
+Defining \l__color_named_myC_prop on line ...
+The color myC has the properties:
+> model => rgb
+> rgb => 0.79 0.79 0.79
+> cmyk => 0.09 0.09 0.09 0.09.
+<recently read> }
+l. ... }
+Defining \l__color_named_myD_tl on line ...
+Defining \l__color_named_myD_prop on line ...
+The color myD has the properties:
+> model => cmyk
+> cmyk => 0.09 0.09 0.09 0.09
+> rgb => 0.79 0.79 0.79.
<recently read> }
l. ... }
============================================================
diff --git a/l3experimental/l3color/testfiles/m3color003.xetex.tlg b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
index 47e130f05..2b5739085 100644
--- a/l3experimental/l3color/testfiles/m3color003.xetex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
@@ -86,16 +86,12 @@ l. ... }
============================================================
TEST 3: Mixing multiple models
============================================================
-Defining \l__color_named_myrgbcmyk_tl on line ...
-Defining \l__color_named_myrgbcmyk_prop on line ...
-Defining \l__color_named_mycmykrgb_tl on line ...
-Defining \l__color_named_mycmykrgb_prop on line ...
Defining \l__color_named_myexpr1_tl on line ...
Defining \l__color_named_myexpr1_prop on line ...
The color myexpr1 has the properties:
> model => rgb
> rgb => 1 0 1
-> cmyk => 1.0 0.0 0.0 1.0.
+> cmyk => 1 0 0 1.
<recently read> }
l. ... }
Defining \l__color_named_myexpr2_tl on line ...
@@ -103,7 +99,23 @@ Defining \l__color_named_myexpr2_prop on line ...
The color myexpr2 has the properties:
> model => cmyk
> cmyk => 1 0 0 1
-> rgb => 1.0 0.0 1.0.
+> rgb => 1 0 1.
+<recently read> }
+l. ... }
+Defining \l__color_named_myC_tl on line ...
+Defining \l__color_named_myC_prop on line ...
+The color myC has the properties:
+> model => rgb
+> rgb => 0.79 0.79 0.79
+> cmyk => 0.09 0.09 0.09 0.09.
+<recently read> }
+l. ... }
+Defining \l__color_named_myD_tl on line ...
+Defining \l__color_named_myD_prop on line ...
+The color myD has the properties:
+> model => cmyk
+> cmyk => 0.09 0.09 0.09 0.09
+> rgb => 0.79 0.79 0.79.
<recently read> }
l. ... }
============================================================
More information about the latex3-commits
mailing list.