[latex3-commits] [git/LaTeX3-latex3-latex3] color-export: Rename export color "annotation" to "space-sep-rgb" (1ae9ff2ab)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Jun 15 11:02:13 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : color-export
Link : https://github.com/latex3/latex3/commit/1ae9ff2ab717d98eabc8256fa8420f05b5187b6a
>---------------------------------------------------------------
commit 1ae9ff2ab717d98eabc8256fa8420f05b5187b6a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Jun 15 10:02:13 2020 +0100
Rename export color "annotation" to "space-sep-rgb"
>---------------------------------------------------------------
1ae9ff2ab717d98eabc8256fa8420f05b5187b6a
l3experimental/l3color/l3color.dtx | 27 +++++++++++++++++--------
l3experimental/l3color/testfiles/m3color002.lvt | 2 +-
l3experimental/l3color/testfiles/m3color002.tlg | 24 +++++++++++-----------
3 files changed, 32 insertions(+), 21 deletions(-)
diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index fa8876f44..1688ebbf6 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -266,14 +266,14 @@
%
% Valid export targets are
% \begin{itemize}
-% \item \texttt{annotation} Space-separated red-green-blue values
-% suitable for use as a PDF annotation color
% \item \texttt{backend} Two brace groups: the first containing the
% model, the second containing space-separated values appropriate
% for the model; this is the format required by backend functions
% of \pkg{expl3}
% \item \texttt{HTML} Uppercase two-digit hexadecimal values, expressing
% a red-green-blue color; the digits are \emph{not} separated
+% \item \texttt{space-sep-rgb} Space-separated red-green-blue values
+% suitable for use as a PDF annotation color
% \end{itemize}
%
% \begin{function}{\color_export:nnN}
@@ -1022,17 +1022,28 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_export_format_annotation:nnN, \@@_export_format_HTML:nnN}
+% \begin{macro}
+% {
+% \@@_export_format_HTML:nnN ,
+% \@@_export_format_space-sep-rgb:nnN
+% }
% \begin{macro}{\@@_export_rgb:nnNN}
-% \begin{macro}{\@@_export_annotation:Nw, \@@_export_HTML:Nw}
+% \begin{macro}
+% {
+% \@@_export_HTML:Nw ,
+% \@@_export_space-sep-rgb:Nw
+% }
% \begin{macro}[EXP]{\@@_export_HTML:n}
% \textsc{html} values must be given in |rgb|: we force conversion if
% required, then do some simple maths.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_export_format_annotation:nnN #1#2#3
- { \@@_export_rgb:nnNN {#1} {#2} #3 \@@_export_annotation:Nw }
\cs_new_protected:Npn \@@_export_format_HTML:nnN #1#2#3
{ \@@_export_rgb:nnNN {#1} {#2}#3 \@@_export_HTML:Nw }
+\cs_new_protected:cpx { @@_export_format_space-sep-rgb:nnN } #1#2#3
+ {
+ \exp_not:N \@@_export_rgb:nnNN {#1} {#2} #3
+ \exp_not:c { @@_export_space-sep-rgb:Nw }
+ }
\cs_new_protected:Npn \@@_export_rgb:nnNN #1#2#3#4
{
\str_if_eq:nnTF {#1} { rgb }
@@ -1043,8 +1054,6 @@
#3 \s_@@_stop
}
}
-\cs_new_protected:Npn \@@_export_annotation:Nw #1#2 \s_@@_stop
- { \tl_set:Nx #1 {#2} }
\cs_new_protected:Npn \@@_export_HTML:Nw #1#2 ~ #3 ~ #4 \s_@@_stop
{
\tl_set:Nx #1
@@ -1060,6 +1069,8 @@
{ 00 }
{ \int_to_Hex:n { \fp_to_int:n { #1 * 255 } } }
}
+\cs_new_protected:cpn { @@_export_space-sep-rgb:Nw } #1#2 \s_@@_stop
+ { \tl_set:Nx #1 {#2} }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/l3experimental/l3color/testfiles/m3color002.lvt b/l3experimental/l3color/testfiles/m3color002.lvt
index 8cd86cc89..4c3be2330 100644
--- a/l3experimental/l3color/testfiles/m3color002.lvt
+++ b/l3experimental/l3color/testfiles/m3color002.lvt
@@ -54,7 +54,7 @@
\TEST { Exporting~colors }
{
\clist_map_inline:nn
- { annotation , backend , HTML }
+ { backend , HTML , space-sep-rgb }
{
\color_export:nnN { blue } {#1} \l_tmpa_tl
\tl_show:N \l_tmpa_tl
diff --git a/l3experimental/l3color/testfiles/m3color002.tlg b/l3experimental/l3color/testfiles/m3color002.tlg
index a765e20c1..078f6b1d3 100644
--- a/l3experimental/l3color/testfiles/m3color002.tlg
+++ b/l3experimental/l3color/testfiles/m3color002.tlg
@@ -69,18 +69,6 @@ l. ... }
============================================================
TEST 3: Exporting colors
============================================================
-> \l_tmpa_tl=0.0 0.0 1.0.
-<recently read> }
-l. ... }
-> \l_tmpa_tl=0.5 0 0.5.
-<recently read> }
-l. ... }
-> \l_tmpa_tl=0 1 1.
-<recently read> }
-l. ... }
-> \l_tmpa_tl=0.6 0.6 0.6.
-<recently read> }
-l. ... }
> \l_tmpa_tl={rgb}{0.0 0.0 1.0}.
<recently read> }
l. ... }
@@ -105,6 +93,18 @@ l. ... }
> \l_tmpa_tl=999999.
<recently read> }
l. ... }
+> \l_tmpa_tl=0.0 0.0 1.0.
+<recently read> }
+l. ... }
+> \l_tmpa_tl=0.5 0 0.5.
+<recently read> }
+l. ... }
+> \l_tmpa_tl=0 1 1.
+<recently read> }
+l. ... }
+> \l_tmpa_tl=0.6 0.6 0.6.
+<recently read> }
+l. ... }
============================================================
============================================================
TEST 4: Exporting color: errors
More information about the latex3-commits
mailing list.