[latex3-commits] [git/LaTeX3-latex3-latex3] color-models: Extend color selection to fill/stroke for separations (87b3183ed)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Aug 6 11:48:12 CEST 2020


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

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

commit 87b3183ed0af03d947b58ee51a61039fc3b86920
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Aug 6 10:48:12 2020 +0100

    Extend color selection to fill/stroke for separations


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

87b3183ed0af03d947b58ee51a61039fc3b86920
 l3backend/l3backend-color.dtx           | 40 +++++++++++++++++++++++++++++++++
 l3experimental/l3color/l3color.dtx      |  9 +++++---
 l3kernel/testfiles/m3expl001.luatex.tlg |  2 ++
 l3kernel/testfiles/m3expl001.ptex.tlg   |  2 ++
 l3kernel/testfiles/m3expl001.tlg        |  2 ++
 l3kernel/testfiles/m3expl001.uptex.tlg  |  2 ++
 l3kernel/testfiles/m3expl001.xetex.tlg  |  2 ++
 l3kernel/testfiles/m3expl003.luatex.tlg |  2 ++
 l3kernel/testfiles/m3expl003.ptex.tlg   |  2 ++
 l3kernel/testfiles/m3expl003.tlg        |  2 ++
 l3kernel/testfiles/m3expl003.uptex.tlg  |  2 ++
 l3kernel/testfiles/m3expl003.xetex.tlg  |  2 ++
 12 files changed, 66 insertions(+), 3 deletions(-)

diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index c3fb26d15..083439a40 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -297,6 +297,19 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}
+%   {
+%     \@@_backend_fill_separation:nn,
+%     \@@_backend_stroke_separation:nn
+%   }
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_fill_separation:nn #1#2
+  { \__kernel_backend_literal_pdf:n { /#1 ~ cs ~ #2 ~ scn } }
+\cs_new_protected:Npn \@@_backend_stroke_separation:nn #1#2
+  { \__kernel_backend_literal_pdf:n { /#1 ~ CS ~ #2 ~ SCN } }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</dvipdfmx|pdfmode|xdvipdfmx>
 %    \end{macrocode}
@@ -331,6 +344,19 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}
+%   {
+%     \@@_backend_fill_separation:nn,
+%     \@@_backend_stroke_separation:nn
+%   }
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_fill_separation:nn #1#2
+  { \__kernel_backend_postscript:n { /color.fc { #1 } def } }
+\cs_new_protected:Npn \@@_backend_stroke_separation:nn #1#2
+  { \__kernel_backend_postscript:n { /color.sc { #1 } def } }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</dvips>
 %    \end{macrocode}
@@ -433,6 +459,20 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}
+%   {
+%     \@@_backend_fill_separation:nn,
+%     \@@_backend_stroke_separation:nn
+%   }
+%   At present, these are no-ops.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_fill_separation:nn #1#2
+  { }
+\cs_new_protected:Npn \@@_backend_stroke_separation:nn #1#2
+  { }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</dvisvgm>
 %    \end{macrocode}
diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index 416ef5abb..8aabfc93a 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -1563,10 +1563,13 @@
     \cs_new_eq:cN { @@_parse_mix_ #6 :nw } \@@_parse_mix_gray:nw
     \cs_new:cpn { @@_parse_model_ #6 :w } ##1 , ##2 \s_@@_stop
       { {#6} { \@@_parse_number:n {##1} } }
-    \cs_new_protected:cpx { @@_backend_select_ #6 :n } ##1
+    \clist_map_inline:nn { fill , stroke , select }
       {
-        \@@_backend_family_separation:nn
-          { color \int_use:N \g_@@_separation_int } {##1}
+        \cs_new_protected:cpx { @@_backend_ ##1 _ #6 :n } ####1
+          {
+            \exp_not:c { @@_backend_ ##1 _ separation:nn }
+              { color \int_use:N \g_@@_separation_int } {####1}
+          }
       }
     \use:c { @@_model_separation_ #8 :nnnnnn }
       {#6} {#7} {#1} {#2} {#3} {#4}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 308ad0777..53cd1b968 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -42,6 +42,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index fa5b59396..91fc18105 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -41,6 +41,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 308ad0777..53cd1b968 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -42,6 +42,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index fa5b59396..91fc18105 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -41,6 +41,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index e959745f6..b85f91a2a 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -38,6 +38,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 308ad0777..53cd1b968 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -42,6 +42,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index fa5b59396..91fc18105 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -41,6 +41,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 308ad0777..53cd1b968 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -42,6 +42,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index fa5b59396..91fc18105 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -41,6 +41,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index e959745f6..b85f91a2a 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -38,6 +38,8 @@ Defining \__color_backend_fill_rgb:n on line ...
 Defining \__color_backend_stroke_cmyk:n on line ...
 Defining \__color_backend_stroke_gray:n on line ...
 Defining \__color_backend_stroke_rgb:n on line ...
+Defining \__color_backend_fill_separation:nn on line ...
+Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...





More information about the latex3-commits mailing list.