[latex3-commits] [l3svn] 02/02: Parsing 'mixed model' colours
noreply at latex-project.org
noreply at latex-project.org
Wed Oct 11 23:22:04 CEST 2017
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
commit 41104c57cd0b53f019e04e06b0c3798c3b16b38f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Oct 11 22:21:40 2017 +0100
Parsing 'mixed model' colours
---
l3trial/l3color-extra/l3color-extra.dtx | 8 ++++----
l3trial/l3color-extra/testfiles/m3color-extra001.lvt | 8 ++++++++
l3trial/l3color-extra/testfiles/m3color-extra001.tlg | 16 +++++++++++++++-
3 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/l3trial/l3color-extra/l3color-extra.dtx b/l3trial/l3color-extra/l3color-extra.dtx
index 3a0774a..d636664 100644
--- a/l3trial/l3color-extra/l3color-extra.dtx
+++ b/l3trial/l3color-extra/l3color-extra.dtx
@@ -193,7 +193,7 @@
% \@@_convert_rgb_gray:w
% \@@_convert_rgb_cmyk:w
% }
-% \begin{macro}[aux, EXP]{\@@_convert_rgb_cmyk:nnnnn}
+% \begin{macro}[aux, EXP]{\@@_convert_rgb_cmyk:nnnn}
% Model conversion is carried out using standard formulae, as described in
% the manual for \pkg{xcolor} (see also the \emph{PostScript Language
% Reference Manual}).
@@ -229,10 +229,10 @@
% \begin{macrocode}
\cs_new:Npn \@@_convert_rgb_cmyk:w #1 ~ #2 ~ #3 ~ #4 \q_stop
{
- \exp_args:Nf \@@_convert_rgb_cmyk:nnnnn
- { \fp_eval:n { min ( 1 - #1 , 1 - #2 , 1 - #3 ) } {#1} {#2} {#3} }
+ \exp_args:Nf \@@_convert_rgb_cmyk:nnnn
+ { \fp_eval:n { min ( 1 - #1 , 1 - #2 , 1 - #3 ) } } {#1} {#2} {#3}
}
-\cs_new:Npn \@@_convert_rgb_cmyk:nnnnn #1#2#3#4
+\cs_new:Npn \@@_convert_rgb_cmyk:nnnn #1#2#3#4
{
\fp_eval:n { min ( 1 , max ( 0 , 1 - #2 - #1 ) ) } \c_space_tl
\fp_eval:n { min ( 1 , max ( 0 , 1 - #3 - #1 ) ) } \c_space_tl
diff --git a/l3trial/l3color-extra/testfiles/m3color-extra001.lvt b/l3trial/l3color-extra/testfiles/m3color-extra001.lvt
index 33aa43e..1abe74d 100644
--- a/l3trial/l3color-extra/testfiles/m3color-extra001.lvt
+++ b/l3trial/l3color-extra/testfiles/m3color-extra001.lvt
@@ -49,6 +49,14 @@
\color_show:n { foo5 }
}
+\TEST { Naming~colors~by~expression~with~model~conversion }
+ {
+ \color_set:nn { foo1 } { red!50!cyan }
+ \color_show:n { foo1 }
+ \color_set:nn { foo2 } { cyan!50!red }
+ \color_show:n { foo2 }
+ }
+
\TEST { Showing~colors }
{
\color_show:n { unknown }
diff --git a/l3trial/l3color-extra/testfiles/m3color-extra001.tlg b/l3trial/l3color-extra/testfiles/m3color-extra001.tlg
index d242d2d..2f82778 100644
--- a/l3trial/l3color-extra/testfiles/m3color-extra001.tlg
+++ b/l3trial/l3color-extra/testfiles/m3color-extra001.tlg
@@ -74,7 +74,21 @@ The color foo5 has the properties:
l. ... }
============================================================
============================================================
-TEST 4: Showing colors
+TEST 4: Naming colors by expression with model conversion
+============================================================
+The color foo1 has the properties:
+> model => rgb
+> value => 0.5, 0.5, 0.5.
+<recently read> }
+l. ... }
+The color foo2 has the properties:
+> model => cmyk
+> value => 0.5, 0.5, 0.5, 0.
+<recently read> }
+l. ... }
+============================================================
+============================================================
+TEST 5: Showing colors
============================================================
The color unknown is undefined.
> .
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list