From 8c82df0007c957004cc2268b49ccf3ceca914f58 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 14 Nov 2017 21:07:53 +0000
Subject: l3 (14nov17)

git-svn-id: svn://tug.org/texlive/trunk@45802 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/l3kernel/l3dvips.def | 37 ++++++++++++++++++++----
 1 file changed, 31 insertions(+), 6 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/l3kernel/l3dvips.def')

diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def
index eed9fcf2658..046edf1d5a7 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def
@@ -22,20 +22,45 @@
 \ProvidesExplFile
   {l3dvips.def}{2017/03/18}{}
   {L3 Experimental driver: dvips}
+\cs_new_protected:Npn \__driver_color_pickup:N #1 { }
 \AtBeginDocument
   {
     \@ifpackageloaded { color }
       {
-        \cs_new_protected:Npn \__driver_color_pickup:
-          { \tl_set:Nx \l__color_current_tl { \current@color } }
+        \cs_set_protected:Npn \__driver_color_pickup:N #1
+          {
+            \exp_args:NV \tl_if_head_is_space:nTF \current@color
+              {
+                \tl_set:Nx #1
+                   {
+                     spot ~
+                     \exp_after:wN \use:n \current@color \c_space_tl 1
+                   }
+              }
+              { \exp_after:wN \__driver_color_pickup_aux:w \current@color \q_stop #1 }
+          }
+        \cs_new_protected:Npn \__driver_color_pickup_aux:w #1 ~ #2 \q_stop #3
+          { \tl_set:Nn #3 { #1 ~ #2 } }
       }
-      { \cs_new_protected:Npn \__driver_color_pickup: { } }
+      { }
   }
-\cs_new_protected:Npn \__driver_color_ensure_current:
+\cs_new_protected:Npn \__driver_color_select:n #1
   {
-    \__driver_color_pickup:
-    \tex_special:D { color~push~\l__color_current_tl }
+    \tex_special:D
+      {
+        color~push~
+        \cs_if_exist_use:cF
+          { __driver_color_convert_ \__driver_convert_model:w #1 \q_stop :n }
+          { \use:n }
+            {#1}
+      }
   }
+\cs_generate_variant:Nn \__driver_color_select:n { V }
+\cs_new:Npn \__driver_convert_model:w #1 ~ #2 \q_stop {#1}
+\cs_new:Npn \__driver_color_convert_spot:n #1
+  { \__driver_color_convert_spot:w #1 \q_stop }
+\cs_new:Npn \__driver_color_convert_spot:w #1 ~ #2 ~ #3 \q_stop
+  { \c_space_tl #2 }
 \cs_new_protected:Npn \__driver_color_reset:
   { \tex_special:D { color~pop } }
 \cs_new_protected:Npn \__driver_literal:n #1
-- 
cgit v1.2.3

