summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3backend/l3backend-color.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3backend/l3backend-color.dtx')
-rw-r--r--macros/latex/contrib/l3backend/l3backend-color.dtx82
1 files changed, 31 insertions, 51 deletions
diff --git a/macros/latex/contrib/l3backend/l3backend-color.dtx b/macros/latex/contrib/l3backend/l3backend-color.dtx
index 336ff45135..dabf728427 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-08-05}
+% \date{Released 2022-08-23}
%
% \maketitle
%
@@ -79,31 +79,24 @@
% \begin{macro}{\@@_backend_pickup:N}
% \begin{macro}{\@@_backend_pickup:w}
% Allow for \LaTeXe{} color. Here, the possible input values are limited:
-% \texttt{dvips}-style colors can mainly be taken as-is with the exception
-% spot ones (here we need a model and a tint). The \texttt{x}-type expansion
+% \texttt{dvips}-style colors can be taken as-is. The \texttt{x}-type expansion
% is there to cover the case where \pkg{xcolor} is in use.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_pickup:N #1 { }
-\cs_if_exist:cT { ver@color.sty }
+\cs_new_protected:Npn \@@_backend_pickup:N #1
{
- \cs_set_protected:Npn \@@_backend_pickup:N #1
+ \exp_args:NV \tl_if_head_is_space:nTF \current@color
{
- \exp_args:NV \tl_if_head_is_space:nTF \current@color
- {
- \tl_set:Nx #1
- {
- { named }
- { \exp_after:wN \use:n \current@color }
- }
- }
- {
- \exp_last_unbraced:Nx \@@_backend_pickup:w
- { \current@color } \s_@@_stop #1
- }
+ \tl_set:Nn #1 { { gray } { 0 } }
+ \msg_warning:nnx { color } { unhandled }
+ { \current@color }
+ }
+ {
+ \exp_last_unbraced:Nx \@@_backend_pickup:w
+ { \current@color } \s_@@_stop #1
}
- \cs_new_protected:Npn \@@_backend_pickup:w #1 ~ #2 \s_@@_stop #3
- { \tl_set:Nn #3 { {#1} {#2} } }
}
+\cs_new_protected:Npn \@@_backend_pickup:w #1 ~ #2 \s_@@_stop #3
+ { \tl_set:Nn #3 { {#1} {#2} } }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -120,41 +113,28 @@
%
% \begin{macro}{\@@_backend_pickup:N}
% \begin{macro}{\@@_backend_pickup:w}
-% The current color in driver-dependent format: pick up the package-mode
-% data if available. We end up converting back and forward in this route as
-% we store our color data in \texttt{dvips} format.
-% The \tn{current@color} needs to be \texttt{x}-expanded before
-% \cs{@@_backend_pickup:w} breaks it apart, because for instance
-% \pkg{xcolor} sets it to be instructions to generate a color
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_pickup:N #1 { }
-\cs_if_exist:cT { ver@color.sty }
+% Same ideas, but with a different backend-dependent format.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_pickup:N #1
{
- \cs_set_protected:Npn \@@_backend_pickup:N #1
- {
- \exp_last_unbraced:Nx \@@_backend_pickup:w
- { \current@color } ~ 0 ~ 0 ~ 0 \s_@@_stop #1
- }
- \cs_new_protected:Npn \@@_backend_pickup:w
- #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 \s_@@_stop #7
+ \exp_last_unbraced:Nx \@@_backend_pickup:w
+ { \current@color } ~ 0 ~ 0 ~ 0 \s_@@_stop #1
+ }
+\cs_new_protected:Npn \@@_backend_pickup:w
+ #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 \s_@@_stop #7
+ {
+ \str_if_eq:nnTF {#2} { g }
+ { \tl_set:Nn #7 { { gray } {#1} } }
{
- \str_if_eq:nnTF {#2} { g }
- { \tl_set:Nn #7 { { gray } {#1} } }
+ \str_if_eq:nnTF {#4} { rg }
+ { \tl_set:Nn #7 { { rgb } { #1 ~ #2 ~ #3 } } }
{
- \str_if_eq:nnTF {#4} { rg }
- { \tl_set:Nn #7 { { rgb } { #1 ~ #2 ~ #3 } } }
+ \str_if_eq:nnTF {#5} { k }
+ { \tl_set:Nn #7 { { cmyk } { #1 ~ #2 ~ #3 ~ #4 } } }
{
- \str_if_eq:nnTF {#5} { k }
- { \tl_set:Nn #7 { { cmyk } { #1 ~ #2 ~ #3 ~ #4 } } }
- {
- \str_if_eq:nnTF {#2} { cs }
- {
- \tl_set:Nx #7 { { \use:n #1 } { #5 } }
- }
- {
- \tl_set:Nn #7 { { gray } { 0 } }
- }
- }
+ \tl_set:Nn #1 { { gray } { 0 } }
+ \msg_warning:nnx { color } { unhandled }
+ { \current@color }
}
}
}