[latex3-commits] [git/LaTeX3-latex3-latex3] color-multi-model: Store 'main' color model data in all cases (feea9f5d1)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue Jun 16 10:47:29 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : color-multi-model
Link : https://github.com/latex3/latex3/commit/feea9f5d107defe9890356f040a3443477223c4e
>---------------------------------------------------------------
commit feea9f5d107defe9890356f040a3443477223c4e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Jun 16 09:47:03 2020 +0100
Store 'main' color model data in all cases
>---------------------------------------------------------------
feea9f5d107defe9890356f040a3443477223c4e
l3experimental/l3color/l3color.dtx | 40 ++++++++++------------
.../l3color/testfiles/m3color001.ptex.tlg | 2 ++
l3experimental/l3color/testfiles/m3color001.tlg | 2 ++
.../l3color/testfiles/m3color001.uptex.tlg | 2 ++
.../l3color/testfiles/m3color001.xetex.tlg | 2 ++
.../l3color/testfiles/m3color003.ptex.tlg | 1 +
l3experimental/l3color/testfiles/m3color003.tlg | 1 +
.../l3color/testfiles/m3color003.uptex.tlg | 1 +
.../l3color/testfiles/m3color003.xetex.tlg | 1 +
9 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index e5388cde3..bbe018fdd 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -955,20 +955,6 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\@@_store:Nn}
-% Store the named color unless it has an invalid name.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_store:Nn #1#2
- {
- \str_if_eq:nnF {#2} { . }
- {
- \tl_clear_new:c { l_@@_named_ #2 _tl }
- \tl_set_eq:cN { l_@@_named_ #2 _tl } #1
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\color_set:nn}
% \begin{macro}{\color_set:nnn}
% \begin{macro}{\@@_set:nw}
@@ -981,19 +967,23 @@
% \begin{macrocode}
\cs_new_protected:Npn \color_set:nn #1#2
{
- \@@_parse:nN {#2} \l_@@_named_tl
- \@@_store:Nn \l_@@_named_tl {#1}
+ \str_if_eq:nnF {#1} { . }
+ {
+ \@@_parse:nN {#2} \l_@@_named_tl
+ \exp_args:Nnx \@@_set_store:nn {#1}
+ { \exp_after:wN \use_i:nn \l_@@_named_tl }
+ }
}
\cs_new_protected:Npn \color_set:nnn #1#2#3
- { \@@_set:nw {#1} #2 / / \s_@@_mark #3 / / \s_@@_stop }
+ {
+ \str_if_eq:nnF {#1} { . }
+ { \@@_set:nw {#1} #2 / / \s_@@_mark #3 / / \s_@@_stop }
+ }
\cs_new_protected:Npn \@@_set:nw
#1#2 / #3 / #4 \s_@@_mark #5 / #6 / #7 \s_@@_stop
{
\@@_select:nnN {#2} {#5} \l_@@_named_tl
- \@@_store:Nn \l_@@_named_tl {#1}
- \prop_clear_new:c { l_@@_named_ #1 _prop }
- \prop_put:cnx { l_@@_named_ #1 _prop } {#2}
- { \exp_after:wN \use_ii:nn \l_@@_named_tl }
+ \@@_set_store:nn {#1} {#2}
\@@_set_loop:nw {#1} #3 / #4 \s_@@_mark #6 / #7 \s_@@_stop
}
\cs_new_protected:Npn \@@_set_loop:nw
@@ -1007,6 +997,14 @@
\@@_set_loop:nw {#1} #3 \s_@@_mark #5 \s_@@_stop
}
}
+\cs_new_protected:Npn \@@_set_store:nn #1#2
+ {
+ \tl_clear_new:c { l_@@_named_ #1 _tl }
+ \tl_set_eq:cN { l_@@_named_ #1 _tl } \l_@@_named_tl
+ \prop_clear_new:c { l_@@_named_ #1 _prop }
+ \prop_put:cnx { l_@@_named_ #1 _prop } {#2}
+ { \exp_after:wN \use_ii:nn \l_@@_named_tl }
+ }
\cs_new_protected:Npn \color_set_eq:nn #1#2
{
\@@_if_defined:nTF {#2}
diff --git a/l3experimental/l3color/testfiles/m3color001.ptex.tlg b/l3experimental/l3color/testfiles/m3color001.ptex.tlg
index a1169e8fe..d18d4c461 100644
--- a/l3experimental/l3color/testfiles/m3color001.ptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color001.ptex.tlg
@@ -64,12 +64,14 @@ The color foo3 has the properties:
<recently read> }
l. ... }
Defining \l__color_named_foo4_tl on line ...
+Defining \l__color_named_foo4_prop on line ...
The color foo4 has the properties:
> model => rgb
> value => 0.125 0.125 0.75.
<recently read> }
l. ... }
Defining \l__color_named_foo5_tl on line ...
+Defining \l__color_named_foo5_prop on line ...
The color foo5 has the properties:
> model => cmyk
> value => 0.02 0.18 0.8 0.
diff --git a/l3experimental/l3color/testfiles/m3color001.tlg b/l3experimental/l3color/testfiles/m3color001.tlg
index cbcf0f09c..a53f43b70 100644
--- a/l3experimental/l3color/testfiles/m3color001.tlg
+++ b/l3experimental/l3color/testfiles/m3color001.tlg
@@ -64,12 +64,14 @@ The color foo3 has the properties:
<recently read> }
l. ... }
Defining \l__color_named_foo4_tl on line ...
+Defining \l__color_named_foo4_prop on line ...
The color foo4 has the properties:
> model => rgb
> value => 0.125 0.125 0.75.
<recently read> }
l. ... }
Defining \l__color_named_foo5_tl on line ...
+Defining \l__color_named_foo5_prop on line ...
The color foo5 has the properties:
> model => cmyk
> value => 0.02 0.18 0.8 0.
diff --git a/l3experimental/l3color/testfiles/m3color001.uptex.tlg b/l3experimental/l3color/testfiles/m3color001.uptex.tlg
index a1169e8fe..d18d4c461 100644
--- a/l3experimental/l3color/testfiles/m3color001.uptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color001.uptex.tlg
@@ -64,12 +64,14 @@ The color foo3 has the properties:
<recently read> }
l. ... }
Defining \l__color_named_foo4_tl on line ...
+Defining \l__color_named_foo4_prop on line ...
The color foo4 has the properties:
> model => rgb
> value => 0.125 0.125 0.75.
<recently read> }
l. ... }
Defining \l__color_named_foo5_tl on line ...
+Defining \l__color_named_foo5_prop on line ...
The color foo5 has the properties:
> model => cmyk
> value => 0.02 0.18 0.8 0.
diff --git a/l3experimental/l3color/testfiles/m3color001.xetex.tlg b/l3experimental/l3color/testfiles/m3color001.xetex.tlg
index 46a78ad98..7276a7f3d 100644
--- a/l3experimental/l3color/testfiles/m3color001.xetex.tlg
+++ b/l3experimental/l3color/testfiles/m3color001.xetex.tlg
@@ -64,12 +64,14 @@ The color foo3 has the properties:
<recently read> }
l. ... }
Defining \l__color_named_foo4_tl on line ...
+Defining \l__color_named_foo4_prop on line ...
The color foo4 has the properties:
> model => rgb
> value => 0.125 0.125 0.75.
<recently read> }
l. ... }
Defining \l__color_named_foo5_tl on line ...
+Defining \l__color_named_foo5_prop on line ...
The color foo5 has the properties:
> model => cmyk
> value => 0.02 0.18 0.8 0.
diff --git a/l3experimental/l3color/testfiles/m3color003.ptex.tlg b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
index 27771fd9e..fcd6e5a22 100644
--- a/l3experimental/l3color/testfiles/m3color003.ptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
@@ -76,6 +76,7 @@ TEST 2: Multiple models: named
Defining \l__color_named_foo1_tl on line ...
Defining \l__color_named_foo1_prop on line ...
Defining \l__color_named_test_tl on line ...
+Defining \l__color_named_test_prop on line ...
The color test has the properties:
> model => cmyk
> value => 0.55 0.1 0.15 0.2.
diff --git a/l3experimental/l3color/testfiles/m3color003.tlg b/l3experimental/l3color/testfiles/m3color003.tlg
index 30372dd11..a39e06edc 100644
--- a/l3experimental/l3color/testfiles/m3color003.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.tlg
@@ -71,6 +71,7 @@ TEST 2: Multiple models: named
Defining \l__color_named_foo1_tl on line ...
Defining \l__color_named_foo1_prop on line ...
Defining \l__color_named_test_tl on line ...
+Defining \l__color_named_test_prop on line ...
The color test has the properties:
> model => cmyk
> value => 0.55 0.1 0.15 0.2.
diff --git a/l3experimental/l3color/testfiles/m3color003.uptex.tlg b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
index 27771fd9e..fcd6e5a22 100644
--- a/l3experimental/l3color/testfiles/m3color003.uptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
@@ -76,6 +76,7 @@ TEST 2: Multiple models: named
Defining \l__color_named_foo1_tl on line ...
Defining \l__color_named_foo1_prop on line ...
Defining \l__color_named_test_tl on line ...
+Defining \l__color_named_test_prop on line ...
The color test has the properties:
> model => cmyk
> value => 0.55 0.1 0.15 0.2.
diff --git a/l3experimental/l3color/testfiles/m3color003.xetex.tlg b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
index 3e2fb25a4..1ba149d0d 100644
--- a/l3experimental/l3color/testfiles/m3color003.xetex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
@@ -71,6 +71,7 @@ TEST 2: Multiple models: named
Defining \l__color_named_foo1_tl on line ...
Defining \l__color_named_foo1_prop on line ...
Defining \l__color_named_test_tl on line ...
+Defining \l__color_named_test_prop on line ...
The color test has the properties:
> model => cmyk
> value => 0.55 0.1 0.15 0.2.
More information about the latex3-commits
mailing list.