diff options
author | Norbert Preining <norbert@preining.info> | 2021-02-24 03:01:25 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-02-24 03:01:25 +0000 |
commit | 55f834f428a0c05dedecc8d33a1c5300e58c91fc (patch) | |
tree | 149edecdb34c91f142df481ba9bbb6d74f8f62f6 /macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty | |
parent | 22774c08f9f3ee390346355cda22d5e5fa667d78 (diff) |
CTAN sync 202102240301
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.sty | 98 |
1 files changed, 98 insertions, 0 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 new file mode 100644 index 0000000000..c49a000fa2 --- /dev/null +++ b/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty @@ -0,0 +1,98 @@ +%% LaTeX2e file `xcolor-patches.sty' +%% +\ProvidesPackage{xcolor-patches-tmp-ltx}[2021/02/22 v0.95a patch xcolor for l3color] +\@ifundefined{color_set:nn}{\RequirePackage{l3color}}{} + +\ExplSyntaxOn +\cs_gset_protected:Npn \@expl@xcolor@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} + { + \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. + \color_set:nnn{#1}{#2}{#3} + } + } + } + \cs_generate_variant:Nn \color_set:nn {ne} + \cs_new_protected:Npn \@expl@xcolor@set@@ne #1 #2 + { + \exp_args:Nx \__color_if_defined:nT {#2} + { \color_set:ne {#1}{#2} } + } +\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} + +%\pretocmd{\XC@definec@lor}{\@expl@color@set@@nnn{#2}{#4}{#5}}{}{\fail} +\def\XC@definec@lor[#1]#2[#3]#4#5% + {\@expl@xcolor@set@@nnn{#2}{#4}{#5}% + \begingroup + \XC@sdef\@@cls{#1}\XC@edef\@@nam{#2}\edef\colornameprefix{#3}% + \XC@logdef\@@nam + \XC@getmodclr02{#4}{#5}{\let\@@tmp\relax}% + {\ifx\@@mod\XC@mod@named + \XC@c@l@rlet\@@nam\@@clr + \else + \ifx\@@cls\XC@mod@ps + \edef\@@drv{\@@mod\space\@@clr}\def\@@hue{0}% + \edef\@@clr{\@nameuse{XC@clr@\@@mod @white}}% + \else + \ifconvertcolorsD + \let\@@tmp\@@mod\XC@sdef\@@mod{\XC@tgt@mod\@@tmp}% + \convertcolorspec\@@tmp\@@clr\@@mod\@@clr + \fi + \XC@coremodel\@@mod\@@clr + \csname color@\@@mod\expandafter\endcsname + \expandafter\@@drv\expandafter{\@@clr}% + \ifcase\XC@@xcp@ + \immediate\write\XC@@xcp{/\colornameprefix\@@nam{\expandafter + \XC@strip@comma\@@clr,,\@nnil}XC\@@mod}% + \let\@@cls\XC@mod@named + \fi + \ifx\@@cls\@empty\else + \let\@@tmp\@@cls + \@nameuse{define@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@stop} |