%%
%% This is file `lwarp-xcolor.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `xcolor')
%% This is a generated file.
%% Copyright 2016-2022 Brian Dunn
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.



\LWR@ProvidesPackagePass{xcolor}[2016/05/11]

\let\color@endgroup\endgroup

\LetLtxMacro\LWR@print@pagecolor\pagecolor
\LetLtxMacro\LWR@print@nopagecolor\nopagecolor
\appto\LWR@restoreorigformatting{%
    \LetLtxMacro\pagecolor\LWR@print@pagecolor%
    \LetLtxMacro\nopagecolor\LWR@print@nopagecolor%
}
\DeclareRobustCommand{\LWR@HTML@normalcolor}{\color{black}}%

\LWR@formatted{normalcolor}
\renewcommand*{\LWR@findcurrenttextcolor}{%
    \LWR@traceinfo{LWR@findcurrenttextcolor}%
    \protect\colorlet{LWR@current@color}{.}%
    \LWR@traceinfo{LWR@findcurrenttextcolor B}%
    \protect\convertcolorspec{named}{LWR@current@color}{HTML}\LWR@tempcolor\relax%
    \LWR@traceinfo{LWR@findcurrenttextcolor: done}%
}

\newcommand*{\LWR@currenttextcolorstyle}{%
    \LWR@findcurrenttextcolor%
    \ifdefstring{\LWR@tempcolor}{000000}%
        {}%
        {color: \LWR@origpound\LWR@tempcolor ; }%
}
\DeclareDocumentCommand{\LWR@textcurrentcolor}{m}{%
    \begingroup%
    \LWR@hook@processingtags%
    \LWR@findcurrenttextcolor%
    \InlineClass[color:\LWR@origpound\LWR@tempcolor]{textcolor}{%
        \renewcommand*{\LWR@currenttextcolor}{\LWR@origpound\LWR@tempcolor}%
        #1%
    }%
    \endgroup%
}
\NewDocumentCommand{\LWR@colorstyle}{m m}{%
    \begingroup%
    \LWR@hook@processingtags%
    \convertcolorspec{#1}{#2}{HTML}\LWR@tempcolor%
    \LWR@origpound\LWR@tempcolor%
    \endgroup%
}
\NewDocumentCommand{\LWR@backgroundcolor}{O{named} m m}{%
    \begingroup%
    \LWR@hook@processingtags%
    \InlineClass[background:\LWR@colorstyle{#1}{#2}]{backgroundcolor}{%
        #3%
    }%
    \endgroup%
}
\newcommand*{\LWR@borderpadding}[2]{%
    border:\LWR@printlength{\LWR@atleastonept} solid \LWR@colorstyle{#1}{#2} ; %
    padding:\LWR@printlength{\fboxsep}%
}
\NewDocumentCommand{\LWR@HTML@color}{o m}{%
    \IfValueTF{#1}{%
        \LWR@print@color[#1]{#2}%
        \convertcolorspec{#1}{#2}{HTML}\LWR@tempcolor%
    }{%
        \LWR@print@color{#2}%
        \convertcolorspec{named}{#2}{HTML}\LWR@tempcolor%
    }%
    \edef\LWR@currenttextcolor{\LWR@origpound\LWR@tempcolor}%
}

\LWR@formatted{color}
\NewDocumentCommand{\LWR@HTML@textcolor}{o m m}{%
    \begingroup%
    \LWR@hook@processingtags%
    \IfValueTF{#1}{%
        \color[#1]{#2}%
    }{%
        \color{#2}%
    }%
    \InlineClass[color:\LWR@currenttextcolor]{textcolor}{#3}%
    \endgroup%
}%

\LWR@formatted{textcolor}

\renewcommand*{\pagecolor}[2][named]{}

\renewcommand*{\nopagecolor}{}

\NewDocumentCommand{\LWR@HTML@colorbox}{O{named} m +m}{%
    \begingroup%
    \LWR@hook@processingtags%
    \InlineClass[%
    background:\LWR@colorstyle{#1}{#2} ; %
    padding:\LWR@printlength{\fboxsep}%
    ]{colorbox}{#3}%
    \endgroup%
}

\NewDocumentCommand{\LWR@HTML@colorboxBlock}{O{named} m +m}{%
    \begingroup%
    \LWR@hook@processingtags%
    \LWR@stoppars%
    \begin{BlockClass}[%
        background:\LWR@colorstyle{#1}{#2} ; %
        padding:\LWR@printlength{\fboxsep}%
    ]{colorboxBlock}
    #3
    \end{BlockClass}%
    \endgroup%
    \global\booltrue{LWR@minipagethispar}%
}

\NewDocumentCommand{\LWR@HTML@fcolorbox}{O{named} m O{#1} m +m}{%
    \LWR@traceinfo{HTML fcolorbox #2 #4}%
    \begingroup%
    \LWR@hook@processingtags%
    \LWR@forceminwidth{\fboxrule}%
    \ifthenelse{\equal{#4}{none}}%
        {% no background color
            \InlineClass[%
            \LWR@borderpadding{#1}{#2}%
            ]{fcolorbox}{#5}%
        }%
        {% yes background color
            \InlineClass[%
            \LWR@borderpadding{#1}{#2} ; %
            background:\LWR@colorstyle{#3}{#4}%
            ]{fcolorbox}{#5}%
        }%
    \endgroup%
}

\NewDocumentCommand{\LWR@HTML@fcolorboxBlock}{O{named} m O{#1} m +m d()}{%
    \LWR@traceinfo{HTML fcolorboxBlock #2 #4}%
    \begingroup%
    \LWR@hook@processingtags%
    \LWR@forceminwidth{\fboxrule}%
    \LWR@stoppars%
    \ifthenelse{\equal{#4}{none}}%
        {% no background color
            \begin{BlockClass}[%
                \LWR@borderpadding{#1}{#2}%
                \IfValueT{#6}{ ; #6}%
            ]{fcolorboxBlock}
            #5
            \end{BlockClass}%
        }%
        {% yes background color
            \convertcolorspec{#3}{#4}{HTML}\LWR@tempcolortwo%
            \begin{BlockClass}[%
                background:\LWR@origpound\LWR@tempcolortwo\ ; %
                \LWR@borderpadding{#1}{#2}%
                \IfValueT{#6}{ ; #6}%
            ]{fcolorboxBlock}
            #5
            \end{BlockClass}%
        }%
    \endgroup%
    \global\booltrue{LWR@minipagethispar}%
    \LWR@traceinfo{HTML fcolorboxBlock done}%
}

\NewDocumentCommand{\LWR@subfcolorminipage}{m m m m}{%
    \LWR@stoppars%
    \begin{BlockClass}[%
        #3%
        \LWR@borderpadding{#1}{#2} ; %
        \IfValueT{#4}{height:\LWR@printlength{\LWR@tempheight} ; }%
        width:\LWR@printlength{\LWR@tempwidth}%
    ]{fcolorminipage}%
}
\NewDocumentEnvironment{LWR@HTML@fcolorminipage}{O{named} m O{#1} m O{c} o o m}
{%
    \LWR@hook@processingtags%
    \setlength{\LWR@tempwidth}{#8}%
    \IfValueT{#6}{\setlength{\LWR@tempheight}{#6}}%
    \LWR@forceminwidth{\fboxrule}%
    \convertcolorspec{#1}{#2}{HTML}\LWR@tempcolor%
    \ifthenelse{\equal{#4}{none}}%
        {\LWR@subfcolorminipage{#1}{#2}{}{#6}}%
        {%
            \convertcolorspec{#3}{#4}{HTML}\LWR@tempcolortwo%
            \LWR@subfcolorminipage{#1}{#2}%
                {background:\LWR@origpound\LWR@tempcolortwo\ ; }%
                {#6}%
        }%
}%
{%
    \end{BlockClass}%
    \global\booltrue{LWR@minipagethispar}%
}
\newcommand*{\LWR@HTML@boxframe}[3]{%
    {%
        \setlength{\LWR@tempwidth}{#1}%
        \setlength{\LWR@tempheight}{#2}%
        \addtolength{\LWR@tempheight}{#3}%
        \LWR@forceminwidth{\fboxrule}%
        \LWR@findcurrenttextcolor%
        \InlineClass[%
            display:inline-block ; %
            border:%
                \LWR@printlength{\LWR@atleastonept} % space
                solid % space
                \LWR@currenttextcolor{} ; % space
            width:\LWR@printlength{\LWR@tempwidth} ; %
            height:\LWR@printlength{\LWR@tempheight}%
        ]{boxframe}{}%
    }%
}

\LWR@formatted{boxframe}
\endinput
%%
%% End of file `lwarp-xcolor.sty'.
