[latex3-commits] [git/LaTeX3-latex3-latex3] color-models: Round out tests for CIELAB color (d4d7396fd)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Jul 17 12:02:07 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : color-models
Link       : https://github.com/latex3/latex3/commit/d4d7396fdd0e40756f4723c03cb7164eb9c93867

>---------------------------------------------------------------

commit d4d7396fdd0e40756f4723c03cb7164eb9c93867
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Jul 17 11:02:07 2020 +0100

    Round out tests for CIELAB color


>---------------------------------------------------------------

d4d7396fdd0e40756f4723c03cb7164eb9c93867
 l3experimental/l3color/l3color.dtx                 |  6 +--
 l3experimental/l3color/testfiles/m3color003.lvt    | 16 ++++++-
 .../l3color/testfiles/m3color003.ptex.tlg          | 53 ++++++++++++++++++++++
 l3experimental/l3color/testfiles/m3color003.tlg    | 43 ++++++++++++++----
 .../l3color/testfiles/m3color003.uptex.tlg         | 53 ++++++++++++++++++++++
 .../l3color/testfiles/m3color003.xetex.tlg         | 53 ++++++++++++++++++++++
 6 files changed, 210 insertions(+), 14 deletions(-)

diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index 3cea35492..047c11374 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -1597,11 +1597,11 @@
       {
         \@@_model_separation_init_cielab:n {#1}
         \@@_model_separation_init_cielab:nnnnn {#2} {#3} {#4} {#5} {#6}
-        \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop
+        \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 ~ ##2 \s_@@_stop
           { 0 ~ 0 ~ 0 ~ 1 }
-        \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop
+        \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 ~ ##2 \s_@@_stop
           { 1 ~ 1 ~ 1 }
-        \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 ~ ##2 \s_@@_stop
+        \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 ~ ##2 \s_@@_stop
           { 1 }
       }
       {
diff --git a/l3experimental/l3color/testfiles/m3color003.lvt b/l3experimental/l3color/testfiles/m3color003.lvt
index 3b08f9497..f9222b84d 100644
--- a/l3experimental/l3color/testfiles/m3color003.lvt
+++ b/l3experimental/l3color/testfiles/m3color003.lvt
@@ -161,14 +161,14 @@
     \test:nn { CMYK } { 0.1 , 0.2 , 0.3 , 0.4 }
     \test:nn { RGB  } { 0.1 , 0.2 , 0.3 }
     \test:nn { Gray } { 0.1 }
-    \color_model_new:nnn { BarToneLab } { Separation }
+    \color_model_new:nnn { BarToneCIELAB } { Separation }
       {
         name = BarTone~555~GN ,
         alternative-model = cielab ,
         alternative-values = {50, -30, -40},
         illuminant = d65
       }
-    \color_show:n { BarToneLab }
+    \color_show:n { BarToneCIELAB }
   }
 
 \TEST { Creating~new~models:~errors }
@@ -205,17 +205,23 @@
   {
     \OMIT
     \color_set:nnn { fooCMYK } { BarToneCMYK } { 1.0 }
+    \color_set:nnn { fooCIELAB } { BarToneCIELAB } { 1.0 }
     \TIMO
     \color_set:nn { foo } { fooCMYK!35 }
     \color_show:n { foo }
     \color_set:nn { foo } { fooCMYK!55!white }
     \color_show:n { foo }
+    \color_set:nn { foo } { fooCMYK!35 }
+    \color_show:n { foo }
+    \color_set:nn { foo } { fooCIELAB!55!white }
+    \color_show:n { foo }
   }
 
 \TEST { Mixing~separation:~failures }
   {
     \OMIT
     \color_set:nnn { fooCMYK } { BarToneCMYK } { 1.0 }
+    \color_set:nnn { fooCIELAB } { BarToneCIELAB } { 1.0 }
     \TIMO
     \color_set:nn { foo } { fooCMYK!35!black }
     \color_show:n { foo }
@@ -223,6 +229,12 @@
     \color_show:n { foo }
     \color_set:nn { foo } { fooCMYK!35!green }
     \color_show:n { foo }
+    \color_set:nn { foo } { fooCIELAB!35!black }
+    \color_show:n { foo }
+    \color_set:nn { foo } { fooCIELAB!35!cyan }
+    \color_show:n { foo }
+    \color_set:nn { foo } { fooCIELAB!35!green }
+    \color_show:n { foo }
   }
 
 \END
diff --git a/l3experimental/l3color/testfiles/m3color003.ptex.tlg b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
index acc4cc1ee..994680b54 100644
--- a/l3experimental/l3color/testfiles/m3color003.ptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.ptex.tlg
@@ -234,6 +234,18 @@ The color fooGray has the properties:
 >  BarToneGray  =>  0.5.
 <recently read> }
 l. ...  }
+Defining \c__color_fallback_BarToneCIELAB_tl on line ...
+Defining \__color_parse_mix_BarToneCIELAB:nw on line ...
+Defining \__color_parse_model_BarToneCIELAB:w on line ...
+Defining \__color_backend_BarToneCIELAB:n on line ...
+Defining \__color_convert_BarToneCIELAB_cmyk:w on line ...
+Defining \__color_convert_BarToneCIELAB_rgb:w on line ...
+Defining \__color_convert_BarToneCIELAB_gray:w on line ...
+Defining \__color_model_BarToneCIELAB_white: on line ...
+The color BarToneCIELAB is undefined.
+> .
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
 TEST 8: Creating new models: errors
@@ -287,6 +299,22 @@ LaTeX has been asked to create a separation color space, but the model given
 as
     alternative-model=<model>
 is unknown.
+! LaTeX3 Error: Separation color space 'foo5' require values for the
+(LaTeX3)        alternative space.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+LaTeX has been asked to create a separation color space, but no 
+    alternative-values=<model>
+key was given with the correct information.
+! LaTeX3 Error: Separation color space 'foo5' require values for the
+(LaTeX3)        alternative space.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+LaTeX has been asked to create a separation color space, but no 
+    alternative-values=<model>
+key was given with the correct information.
 ============================================================
 ============================================================
 TEST 9: Converting new models
@@ -316,6 +344,16 @@ The color foo has the properties:
 >  BarToneCMYK  =>  0.55.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCMYK
+>  BarToneCMYK  =>  0.35.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  0.55.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
 TEST 11: Mixing separation: failures
@@ -335,4 +373,19 @@ The color foo has the properties:
 >  BarToneCMYK  =>  1.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
 ============================================================
diff --git a/l3experimental/l3color/testfiles/m3color003.tlg b/l3experimental/l3color/testfiles/m3color003.tlg
index 364c20658..02aa386f3 100644
--- a/l3experimental/l3color/testfiles/m3color003.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.tlg
@@ -229,15 +229,15 @@ The color fooGray has the properties:
 >  BarToneGray  =>  0.5.
 <recently read> }
 l. ...  }
-Defining \c__color_fallback_BarToneLab_tl on line ...
-Defining \__color_parse_mix_BarToneLab:nw on line ...
-Defining \__color_parse_model_BarToneLab:w on line ...
-Defining \__color_backend_BarToneLab:n on line ...
-Defining \__color_convert_d65_cmyk:w on line ...
-Defining \__color_convert_d65_rgb:w on line ...
-Defining \__color_convert_d65_gray:w on line ...
-Defining \__color_model_BarToneLab_white: on line ...
-The color BarToneLab is undefined.
+Defining \c__color_fallback_BarToneCIELAB_tl on line ...
+Defining \__color_parse_mix_BarToneCIELAB:nw on line ...
+Defining \__color_parse_model_BarToneCIELAB:w on line ...
+Defining \__color_backend_BarToneCIELAB:n on line ...
+Defining \__color_convert_BarToneCIELAB_cmyk:w on line ...
+Defining \__color_convert_BarToneCIELAB_rgb:w on line ...
+Defining \__color_convert_BarToneCIELAB_gray:w on line ...
+Defining \__color_model_BarToneCIELAB_white: on line ...
+The color BarToneCIELAB is undefined.
 > .
 <recently read> }
 l. ...  }
@@ -339,6 +339,16 @@ The color foo has the properties:
 >  BarToneCMYK  =>  0.55.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCMYK
+>  BarToneCMYK  =>  0.35.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  0.55.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
 TEST 11: Mixing separation: failures
@@ -358,4 +368,19 @@ The color foo has the properties:
 >  BarToneCMYK  =>  1.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
 ============================================================
diff --git a/l3experimental/l3color/testfiles/m3color003.uptex.tlg b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
index acc4cc1ee..994680b54 100644
--- a/l3experimental/l3color/testfiles/m3color003.uptex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.uptex.tlg
@@ -234,6 +234,18 @@ The color fooGray has the properties:
 >  BarToneGray  =>  0.5.
 <recently read> }
 l. ...  }
+Defining \c__color_fallback_BarToneCIELAB_tl on line ...
+Defining \__color_parse_mix_BarToneCIELAB:nw on line ...
+Defining \__color_parse_model_BarToneCIELAB:w on line ...
+Defining \__color_backend_BarToneCIELAB:n on line ...
+Defining \__color_convert_BarToneCIELAB_cmyk:w on line ...
+Defining \__color_convert_BarToneCIELAB_rgb:w on line ...
+Defining \__color_convert_BarToneCIELAB_gray:w on line ...
+Defining \__color_model_BarToneCIELAB_white: on line ...
+The color BarToneCIELAB is undefined.
+> .
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
 TEST 8: Creating new models: errors
@@ -287,6 +299,22 @@ LaTeX has been asked to create a separation color space, but the model given
 as
     alternative-model=<model>
 is unknown.
+! LaTeX3 Error: Separation color space 'foo5' require values for the
+(LaTeX3)        alternative space.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+LaTeX has been asked to create a separation color space, but no 
+    alternative-values=<model>
+key was given with the correct information.
+! LaTeX3 Error: Separation color space 'foo5' require values for the
+(LaTeX3)        alternative space.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+LaTeX has been asked to create a separation color space, but no 
+    alternative-values=<model>
+key was given with the correct information.
 ============================================================
 ============================================================
 TEST 9: Converting new models
@@ -316,6 +344,16 @@ The color foo has the properties:
 >  BarToneCMYK  =>  0.55.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCMYK
+>  BarToneCMYK  =>  0.35.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  0.55.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
 TEST 11: Mixing separation: failures
@@ -335,4 +373,19 @@ The color foo has the properties:
 >  BarToneCMYK  =>  1.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
 ============================================================
diff --git a/l3experimental/l3color/testfiles/m3color003.xetex.tlg b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
index 029ddcbe3..f3cd5a69b 100644
--- a/l3experimental/l3color/testfiles/m3color003.xetex.tlg
+++ b/l3experimental/l3color/testfiles/m3color003.xetex.tlg
@@ -229,6 +229,18 @@ The color fooGray has the properties:
 >  BarToneGray  =>  0.5.
 <recently read> }
 l. ...  }
+Defining \c__color_fallback_BarToneCIELAB_tl on line ...
+Defining \__color_parse_mix_BarToneCIELAB:nw on line ...
+Defining \__color_parse_model_BarToneCIELAB:w on line ...
+Defining \__color_backend_BarToneCIELAB:n on line ...
+Defining \__color_convert_BarToneCIELAB_cmyk:w on line ...
+Defining \__color_convert_BarToneCIELAB_rgb:w on line ...
+Defining \__color_convert_BarToneCIELAB_gray:w on line ...
+Defining \__color_model_BarToneCIELAB_white: on line ...
+The color BarToneCIELAB is undefined.
+> .
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
 TEST 8: Creating new models: errors
@@ -282,6 +294,22 @@ LaTeX has been asked to create a separation color space, but the model given
 as
     alternative-model=<model>
 is unknown.
+! LaTeX3 Error: Separation color space 'foo5' require values for the
+(LaTeX3)        alternative space.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+LaTeX has been asked to create a separation color space, but no 
+    alternative-values=<model>
+key was given with the correct information.
+! LaTeX3 Error: Separation color space 'foo5' require values for the
+(LaTeX3)        alternative space.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+LaTeX has been asked to create a separation color space, but no 
+    alternative-values=<model>
+key was given with the correct information.
 ============================================================
 ============================================================
 TEST 9: Converting new models
@@ -311,6 +339,16 @@ The color foo has the properties:
 >  BarToneCMYK  =>  0.55.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCMYK
+>  BarToneCMYK  =>  0.35.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  0.55.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
 TEST 11: Mixing separation: failures
@@ -330,4 +368,19 @@ The color foo has the properties:
 >  BarToneCMYK  =>  1.
 <recently read> }
 l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
+The color foo has the properties:
+>  model  =>  BarToneCIELAB
+>  BarToneCIELAB  =>  1.
+<recently read> }
+l. ...  }
 ============================================================





More information about the latex3-commits mailing list.