summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty')
-rw-r--r--macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty108
1 files changed, 25 insertions, 83 deletions
diff --git a/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty b/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty
index ad78d86b81..88c8bf739d 100644
--- a/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty
+++ b/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty
@@ -1,91 +1,24 @@
%% LaTeX2e file `xcolor-patches.sty'
%%
-\ProvidesPackage{xcolor-patches-tmp-ltx}[2022-07-08 v0.95q patch xcolor for l3color]
+\ProvidesPackage{xcolor-patches-tmp-ltx}[2022-08-24 v0.95r patch xcolor for l3color]
\@ifundefined{color_set:nn}{\RequirePackage{l3color}}{}
\ExplSyntaxOn
-% #1 is the color name
-% #2: model or models
-% #3: value: either numbers or a color name
-% #4 is the type: named or ps
-\cs_gset_protected:Npn \__pdfmanagement_firstaid_xcolor_set:nnnn #1 #2 #3 #4
- {
- \str_case:nnF {#4}
- {
- % we ignore the ps type for now.
- {ps}{}
- {named}
- {
- \cs_if_exist:cT { __color_parse_model_ #2 :w }
- {
- \color_set:nnn {#1}{#2}{#3}
- }
- }
- }
- {
- \cs_if_exist:cTF { __color_parse_model_ #2 :w }
- {
- \color_set:nnn {#1}{#2}{#3}
- }
- {
- \tl_if_eq:nnTF{#2}{named}%this the model not the type!
- {
- \color_set:nn{#1}{#3}
- }
- {
- %this is for multi models, it will break if there is model
- %l3 doesn't know, but the case is rare, so accept it for now.
- \str_if_in:nnT {#2}{/}
- {
- \color_set:nnn{#1}{#2}{#3}
- }
- }
- }
- }
- }
-\cs_generate_variant:Nn \__pdfmanagement_firstaid_xcolor_set:nnnn {nonn}
-\cs_set_eq:NN \@expl@xcolor@set@@nonn \__pdfmanagement_firstaid_xcolor_set:nonn
-\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 \@expl@xcolor@set@@ne #1 #2
- {
- \XC@edef\l__pdfmanagement_firstaid_tmpa_tl{#2}
- \exp_args:NV \__color_if_defined:nT \l__pdfmanagement_firstaid_tmpa_tl
- { \color_set:ne {#1}{\l__pdfmanagement_firstaid_tmpa_tl} }
- }
-\ExplSyntaxOff
-%\pretocmd{\XC@col@rlet} {\@expl@color@set@@ne{#2}{#4}}{}{\fail}
-\def\XC@col@rlet[#1]#2[#3]#4%
- {\@expl@xcolor@set@@ne{#2}{#4}%
- \begingroup
- \edef\@@cls{#1}\XC@edef\@@nam{#2}\XC@sdef\@@mod{#3}\XC@edef\@@clr{#4}%
- \XC@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@logdef\@@nam\XC@c@l@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@definecolor[\@@cls]{\@@nam}\@@clr}%
- \fi
- \expandafter\endgroup\@@tmp\xglobal@stop}
+\cs_set_protected:Npn \expl@color@set@@nnn #1#2#3
+ {
+ \color_set:nnn{#1}{#2}{#3}
+ }
-%\pretocmd{\XC@definec@lor}{\@expl@color@set@@nnn{#2}{#4}{#5}}{}{\fail}
+\cs_set_protected:Npn \expl@color@set@eq@@nn #1 #2
+ {
+ \color_if_exist:nT{#2}
+ {
+ \color_set_eq:nn{#1}{#2}
+ }
+ }
+\ExplSyntaxOff
\def\XC@definec@lor[#1]#2[#3]#4#5%
- {\@expl@xcolor@set@@nonn{#2}{#4}{#5}{#1}%
- \begingroup
+ {\begingroup
\XC@sdef\@@cls{#1}\XC@edef\@@nam{#2}\edef\colornameprefix{#3}%
\XC@logdef\@@nam
\XC@getmodclr02{#4}{#5}{\let\@@tmp\relax}%
@@ -118,10 +51,18 @@
\toks@\expandafter{\@@drv}%
\edef\@@tmp
{\ifglobalcolors\global\else\xglobal@\fi
- \noexpand\@namedef{\string\color@\@@nam}%
- {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}}%
+ \noexpand\@namedef{\@backslashchar color@\@@nam}%
+ {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}%
+ \noexpand\expl@color@set@@nnn{\@@nam}{\@@mod}{\@@clr}}%
\fi}%
\expandafter\endgroup\@@tmp\xglobal@stop}
+\def\XC@c@l@rlet#1#2%
+ {\@ifundefinedcolor{#2}%
+ {\c@lor@error{`#2'}\let\@@tmp\@empty}%
+ {\edef\@@tmp
+ {\ifglobalcolors\global\else\xglobal@\fi
+ \noexpand\XC@let@cc{\@backslashchar color@#1}{\@backslashchar color@#2}%
+ \noexpand\expl@color@set@eq@@nn{#1}{#2}}}}
%re-predefine the colors
\definecolorset{rgb/hsb/cmyk/gray}{}{}%
@@ -139,4 +80,5 @@
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