[latex3-commits] [git/LaTeX3-latex3-pdfresources] develop: restore xcolor patch for release, adapt colorspace patch (e3e9844)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Aug 24 00:20:58 CEST 2022


Repository : https://github.com/latex3/pdfresources
On branch  : develop
Link       : https://github.com/latex3/pdfresources/commit/e3e98442127d5bd227a1be44fb3eb72078a4e8e2

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

commit e3e98442127d5bd227a1be44fb3eb72078a4e8e2
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Aug 24 00:20:58 2022 +0200

    restore xcolor patch for release, adapt colorspace patch


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

e3e98442127d5bd227a1be44fb3eb72078a4e8e2
 firstaid/colorspace-patches-tmp-ltx.sty | 18 +++----
 firstaid/xcolor-patches-tmp-ltx.sty     | 90 +++++++++++++++++++++++++++++++--
 pdfmanagement-firstaid.dtx              |  2 +-
 3 files changed, 97 insertions(+), 13 deletions(-)

diff --git a/firstaid/colorspace-patches-tmp-ltx.sty b/firstaid/colorspace-patches-tmp-ltx.sty
index 733b017..bf20f2c 100644
--- a/firstaid/colorspace-patches-tmp-ltx.sty
+++ b/firstaid/colorspace-patches-tmp-ltx.sty
@@ -35,30 +35,30 @@
   {
     \tl_if_exist:NT \spc at op
       {
-        \__pdf_backend_object_new:nn  {__spc_extgstate_op_false}{dict}
-        \__pdf_backend_object_write:nn
+        \pdf_object_new:nn  {__spc_extgstate_op_false}{dict}
+        \pdf_object_write:nn
           {__spc_extgstate_op_false}
           {/Type /ExtGState~/op~false~/OP~false}
         \pdfmanagement_add:nnn
           {Page/Resources/ExtGState}
           {SPCko}
-          {\__pdf_backend_object_ref:n {__spc_extgstate_op_false}}
-        \__pdf_backend_object_new:nn  {__spc_extgstate_op_true0}{dict}
-        \__pdf_backend_object_write:nn
+          {\pdf_object_ref:n {__spc_extgstate_op_false}}
+        \pdf_object_new:nn  {__spc_extgstate_op_true0}{dict}
+        \pdf_object_write:nn
           {__spc_extgstate_op_true0}
           {/Type /ExtGState~/op~true~/OP~true~/OPM~0}%
         \pdfmanagement_add:nnn
           {Page/Resources/ExtGState}
           {SPCmz}
-          {\__pdf_backend_object_ref:n {__spc_extgstate_op_true0}}
-        \__pdf_backend_object_new:nn  {__spc_extgstate_op_true1}{dict}
-        \__pdf_backend_object_write:nn
+          {\pdf_object_ref:n {__spc_extgstate_op_true0}}
+        \pdf_object_new:nn  {__spc_extgstate_op_true1}{dict}
+        \pdf_object_write:nn
           {__spc_extgstate_op_true1}
           {/Type /ExtGState~/op~true~/OP~true~/OPM~1}%
          \pdfmanagement_add:nnn
           {Page/Resources/ExtGState}
           {SPCop}
-          {\__pdf_backend_object_ref:n {__spc_extgstate_op_true1}}
+          {\pdf_object_ref:n {__spc_extgstate_op_true1}}
       }
   }
 
diff --git a/firstaid/xcolor-patches-tmp-ltx.sty b/firstaid/xcolor-patches-tmp-ltx.sty
index 6db2f32..e6084dd 100644
--- a/firstaid/xcolor-patches-tmp-ltx.sty
+++ b/firstaid/xcolor-patches-tmp-ltx.sty
@@ -1,6 +1,7 @@
 %% LaTeX2e file `xcolor-patches.sty'
 %%
 \ProvidesPackage{xcolor-patches-tmp-ltx}[2022-07-08 v0.95q patch xcolor for l3color]
+\@ifundefined{color_set:nn}{\RequirePackage{l3color}}{}
 
 \ExplSyntaxOn
 % #1 is the color name
@@ -47,13 +48,96 @@
 \cs_generate_variant:Nn \color_set:nn {ne}
 \tl_new:N\l__pdfmanagement_firstaid_tmpa_tl
 % the color name should be sanitized to avoid problems with e.g. french making ! active
-\cs_new_protected:Npn \__pdfmanagement_firstaid_xcolor_set:nn #1 #2
+\cs_new_protected:Npn \@expl at xcolor@set@@ne #1 #2
    {
      \XC at edef\l__pdfmanagement_firstaid_tmpa_tl{#2}
-     \exp_args:NV \__color_if_defined:nT \l__pdfmanagement_firstaid_tmpa_tl
+     \exp_args:NV \color_if_exist:nT \l__pdfmanagement_firstaid_tmpa_tl
        { \color_set:ne {#1}{\l__pdfmanagement_firstaid_tmpa_tl} }
    }
-\cs_set_eq:NN \@expl at xcolor@set@@ne \__pdfmanagement_firstaid_xcolor_set:nn
 \ExplSyntaxOff
+%\pretocmd{\XC at col@rlet}   {\@expl at color@set@@ne{#2}{#4}}{}{\fail}
+\def\XC at col@rlet[#1]#2[#3]#4%
+ {\@expl at xcolor@set@@ne{#2}{#4}%
+  \begingroup
+  \edef\@@cls{#1}\XC at edef\@@nam{#2}\XC at sdef\@@mod{#3}\XC at edef\@@clr{#4}%
+  \XC at info\@@clr\@@tmp\XC@@tstfalse
+  \ifnum\@@tmp=\@ne\ifx\@@mod\@empty
+    \ifx\@@cls\@empty
+      \XC@@tsttrue
+    \else
+      \edef\@@tmp
+       {\expandafter\expandafter\expandafter\@secondoffive
+         \csname\string\color@\@@clr\endcsname}%
+      \ifx\@@cls\@@tmp\XC@@tsttrue\fi
+    \fi
+  \fi\fi
+  \ifXC@@tst
+    \XC at logdef\@@nam\XC at c@l at rlet\@@nam\@@clr
+  \else
+    \extractcolorspec\@@clr\@@clr
+    \ifx\@@mod\@empty\else
+      \expandafter\convertcolorspec\@@clr\@@mod\@@clr
+      \edef\@@clr{{\@@mod}{\@@clr}}\fi
+    \edef\@@tmp{\noexpand\XC at definecolor[\@@cls]{\@@nam}\@@clr}%
+  \fi
+  \expandafter\endgroup\@@tmp\xglobal at stop}
 
+%\pretocmd{\XC at definec@lor}{\@expl at color@set@@nnn{#2}{#4}{#5}}{}{\fail}
+\def\XC at definec@lor[#1]#2[#3]#4#5%
+ {\@expl at xcolor@set@@nonn{#2}{#4}{#5}{#1}%
+  \begingroup
+  \XC at sdef\@@cls{#1}\XC at edef\@@nam{#2}\edef\colornameprefix{#3}%
+  \XC at logdef\@@nam
+  \XC at getmodclr02{#4}{#5}{\let\@@tmp\relax}%
+   {\ifx\@@mod\XC at mod@named
+      \XC at c@l at rlet\@@nam\@@clr
+    \else
+      \ifx\@@cls\XC at mod@ps
+        \edef\@@drv{\@@mod\space\@@clr}\def\@@hue{0}%
+        \edef\@@clr{\@nameuse{XC at clr@\@@mod @white}}%
+      \else
+        \ifconvertcolorsD
+          \let\@@tmp\@@mod\XC at sdef\@@mod{\XC at tgt@mod\@@tmp}%
+          \convertcolorspec\@@tmp\@@clr\@@mod\@@clr
+        \fi
+        \XC at coremodel\@@mod\@@clr
+        \csname color@\@@mod\expandafter\endcsname
+          \expandafter\@@drv\expandafter{\@@clr}%
+        \ifcase\XC@@xcp@
+          \immediate\write\XC@@xcp{/\colornameprefix\@@nam{\expandafter
+            \XC at strip@comma\@@clr,,\@nnil}XC\@@mod}%
+          \let\@@cls\XC at mod@named
+        \fi
+        \ifx\@@cls\@empty\else
+          \let\@@tmp\@@cls
+          \@nameuse{define at color@\@@cls}\@@nam\@@drv
+          \csname color@\@@tmp\expandafter\endcsname
+            \expandafter\@@drv\expandafter{\@@nam}%
+        \fi
+      \fi
+      \toks@\expandafter{\@@drv}%
+      \edef\@@tmp
+       {\ifglobalcolors\global\else\xglobal@\fi
+        \noexpand\@namedef{\string\color@\@@nam}%
+         {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}}%
+    \fi}%
+  \expandafter\endgroup\@@tmp\xglobal at stop}
+
+%re-predefine the colors
+\definecolorset{rgb/hsb/cmyk/gray}{}{}%
+ {brown,.75,.5,.25/.083333,.66667,.75/0,.25,.5,.25/.5475;%
+  lime,.75,1,0/.20833,1,1/.25,0,1,0/.815;%
+  orange,1,.5,0/.083333,1,1/0,.5,1,0/.595;%
+  pink,1,.75,.75/0,.25,1/0,.25,.25,0/.825;%
+  purple,.75,0,.25/.94444,1,.75/0,.75,.5,.25/.2525;%
+  teal,0,.5,.5/.5,1,.5/.5,0,0,.5/.35;%
+  violet,.5,0,.5/.83333,1,.5/0,.5,0,.5/.205}%
+\definecolorset{cmyk/rgb/hsb/gray}{}{}%
+ {olive,0,0,1,.5/.5,.5,0/.16667,1,.5/.39}
+\definecolorset{gray/rgb/hsb/cmyk}{}{}%
+ {darkgray,.25/.25,.25,.25/0,0,.25/0,0,0,.75;%
+  gray,.5/.5,.5,.5/0,0,.5/0,0,0,.5;%
+  lightgray,.75/.75,.75,.75/0,0,.75/0,0,0,.25}
+
+\XC@@names
 \endinput
diff --git a/pdfmanagement-firstaid.dtx b/pdfmanagement-firstaid.dtx
index 9a374c4..58eb0ee 100644
--- a/pdfmanagement-firstaid.dtx
+++ b/pdfmanagement-firstaid.dtx
@@ -173,7 +173,7 @@
   {
     \AddToHook
        {
-         package/xcolor/before
+         package/xcolor/after
        }
        {\RequirePackage{xcolor-patches-tmp-ltx}}
   }





More information about the latex3-commits mailing list.