diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def index 8590bc67530..981badea00d 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def @@ -22,59 +22,68 @@ \ProvidesExplFile {l3pdfmode.def}{2017/03/18}{} {L3 Experimental driver: PDF mode} +\cs_new_protected:Npn \__driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_new_protected:Npn \__driver_color_pickup: + \cs_set_protected:Npn \__driver_color_pickup:N #1 { \exp_last_unbraced:Nx \__driver_color_pickup_aux:w - { \current@color } ~ 0 ~ 0 ~ 0 \q_stop + { \current@color } ~ 0 ~ 0 ~ 0 \q_stop #1 } - \cs_new:Npn \__driver_color_pickup_aux:w #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 \q_stop + \cs_new_protected:Npn \__driver_color_pickup_aux:w + #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 \q_stop #7 { - \tl_set:Nx \l__color_current_tl + \str_if_eq:nnTF {#2} { g } + { \tl_set:Nn #7 { gray ~ #1 } } { - \str_if_eq:nnTF {#2} { g } - { gray ~ #1 } + \str_if_eq:nnTF {#4} { rg } + { \tl_set:Nn #7 { rgb ~ #1 ~ #2 ~ #3 } } { - \str_if_eq:nnTF {#4} { rg } - { rgb ~ #1 ~ #2 ~ #3 } - { - \str_if_eq:nnTF {#5} { k } - { cmyk ~ #1 ~ #2 ~ #3 ~ #4 } - { gray ~ #1 } - } + \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 { spot ~ \use_none:n #1 ~ #5 } + } + { + \tl_set:Nn #7 { gray ~ 0 } + } + } } } } } - { \cs_new_protected:Npn \__driver_color_pickup: { } } + { } } \int_new:N \l__driver_color_stack_int -\cs_new_protected:Npx \__driver_color_ensure_current: +\cs_new_protected:Npx \__driver_color_select:n #1 { - \exp_not:N \__driver_color_pickup: \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D colorstack } { \pdftex_pdfcolorstack:D } \exp_not:N \l__driver_color_stack_int push { - \exp_not:N \exp_after:wN \exp_not:N \__driver_color_convert:w - \exp_not:N \l__color_current_tl - \c_space_tl 0 ~ 0 ~ 0 + #1 \exp_not:N \q_stop } } -\cs_new:Npn \__driver_color_convert:w #1 ~ - { \use:c { __driver_color_convert_ #1 :w } } -\cs_new:Npn \__driver_color_convert_gray:w #1 ~ #2 \q_stop +\cs_generate_variant:Nn \__driver_color_select:n { V } +\cs_new:Npn \__driver_color_convert:w #1 ~ #2 \q_stop + { \use:c { __driver_color_convert_ #1 :w } #2 \q_stop } +\cs_new:Npn \__driver_color_convert_gray:w #1 \q_stop { #1 ~ g ~ #1 ~ G } -\cs_new:Npn \__driver_color_convert_cmyk:w #1 ~ #2 ~ #3 ~ #4 ~#5 \q_stop - { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } -\cs_new:Npn \__driver_color_convert_rgb:w #1 ~ #2 ~ #3 ~ #4 \q_stop - { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } +\cs_new:Npn \__driver_color_convert_cmyk:w #1 \q_stop + { #1 ~ k ~ #1 ~ K } +\cs_new:Npn \__driver_color_convert_rgb:w #1 \q_stop + { #1 ~ rg ~ #1 ~ RG } +\cs_new:Npn \__driver_color_convert_spot:w #1 ~ #2 \q_stop + { + /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ sc ~ #2 ~ SC + } \cs_new_protected:Npx \__driver_color_reset: { \cs_if_exist:NTF \luatex_pdfextension:D |