From d82d72343a5dfcbc4ba14569fba7f9e34debdf71 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 15 Apr 2022 03:00:41 +0000
Subject: CTAN sync 202204150300

---
 macros/latex/contrib/l3backend/l3backend-color.dtx | 24 +++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

(limited to 'macros/latex/contrib/l3backend/l3backend-color.dtx')

diff --git a/macros/latex/contrib/l3backend/l3backend-color.dtx b/macros/latex/contrib/l3backend/l3backend-color.dtx
index 815b41302a..7166fb693d 100644
--- a/macros/latex/contrib/l3backend/l3backend-color.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-color.dtx
@@ -43,7 +43,7 @@
 %    }^^A
 % }
 %
-% \date{Released 2022-04-10}
+% \date{Released 2022-04-14}
 %
 % \maketitle
 %
@@ -91,8 +91,8 @@
           {
             \tl_set:Nx #1
                {
+                 { named }
                  { \exp_after:wN \use:n \current@color }
-                 { 1 }
                }
           }
           {
@@ -353,18 +353,22 @@
 %   {
 %     \@@_backend_select_cmyk:n  ,
 %     \@@_backend_select_gray:n  ,
+%     \@@_backend_select_named:n ,
 %     \@@_backend_select_rgb:n   ,
 %     \@@_backend_select:n
 %   }
 % \begin{macro}{\@@_backend_reset:}
 % \begin{macro}{color.sc}
 %    Push the data to the stack. In the case of \texttt{dvips} also saves the
-%    drawing color in raw PostScript.
+%    drawing color in raw PostScript. The |spot| model is for handling data
+%    in classical format.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_backend_select_cmyk:n #1
   { \@@_backend_select:n { cmyk ~ #1 } }
 \cs_new_protected:Npn \@@_backend_select_gray:n #1
   { \@@_backend_select:n { gray ~ #1 } }
+\cs_new_protected:Npn \@@_backend_select_named:n #1
+  { \@@_backend_select:n { ~ #1 } }
 \cs_new_protected:Npn \@@_backend_select_rgb:n #1
   { \@@_backend_select:n { rgb ~ #1 } }
 \cs_new_protected:Npn \@@_backend_select:n #1
@@ -427,6 +431,20 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\@@_backend_select_named:n}
+%   For classical named colors, the only value we should get is |Black|.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_select_named:n #1
+  {
+    \str_if_eq:nnTF {#1} { Black }
+      { \@@_backend_select_gray:n { 0 } }
+      { \msg_error:nnn { color } { unknown-named-color } {#1} }
+  }
+\msg_new:nnn { color } { unknown-named-color }
+  { Named~color~'#1'~is~not~known. }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</dvipdfmx|luatex|pdftex|xetex>
 %    \end{macrocode}
-- 
cgit v1.2.3

