| 1 |
% color.4ht (2025-06-05-13:26), generated from tex4ht-4ht.tex |
| 2 |
% Copyright 1997-2009 Eitan M. Gurari |
| 3 |
% Copyright 2009-2025 TeX Users Group |
| 4 |
% |
| 5 |
% This work may be distributed and/or modified under the |
| 6 |
% conditions of the LaTeX Project Public License, either |
| 7 |
% version 1.3c of this license or (at your option) any |
| 8 |
% later version. The latest version of this license is in |
| 9 |
% https://www.latex-project.org/lppl.txt |
| 10 |
% and version 1.3c or later is part of all distributions |
| 11 |
% of LaTeX version 2005/12/01 or later. |
| 12 |
% |
| 13 |
% This work has the LPPL maintenance status "maintained". |
| 14 |
% |
| 15 |
% The Current Maintainer of this work |
| 16 |
% is the TeX4ht Project <https://tug.org/tex4ht>. |
| 17 |
% |
| 18 |
% If you modify this program, changing the |
| 19 |
% version identification would be appreciated. |
| 20 |
\immediate\write-1{version 2025-06-05-13:26} |
| 21 |
|
| 22 |
\expandafter\ifx \csname color:def\endcsname\relax |
| 23 |
\let\color:def\def |
| 24 |
\else \expandafter\endinput\fi |
| 25 |
\let\:temp\begingroup |
| 26 |
\HLet\color@setgroup\:temp |
| 27 |
\def\HColor{\:warning{\string\Hcode{...}{...} is deprecated; Use |
| 28 |
\string\Configure{HColor}{...}{...}}\Configure{HColor}} |
| 29 |
\NewConfigure{HColor}[2]{\if !#1!\if!#2!\let\HColor\relax \else \edef\HColor{#2}\fi |
| 30 |
\else |
| 31 |
\expandafter\edef\csname CLR:#1\endcsname{#2}\fi} |
| 32 |
\def\:temp#1#2#3{% |
| 33 |
\@ifundefined{color@#2}% |
| 34 |
{\c@lor@error{model `#2'}}% |
| 35 |
{\@ifundefined{\string\color @#1}{}% |
| 36 |
{\PackageInfo{color}{Redefining color #1}}% |
| 37 |
\csname color@#2\expandafter\endcsname |
| 38 |
\csname\string\color @#1\endcsname{#3}}} |
| 39 |
\ifx \definecolor\:temp |
| 40 |
\pend:defIII\definecolor{% |
| 41 |
\expandafter\ifx\csname HColor:##2\endcsname\relax\else |
| 42 |
\csname HColor:##2\endcsname ##3 //% |
| 43 |
\edef\:temp{{HColor}{##1}{\HColor}}% |
| 44 |
\expandafter\Configure\:temp |
| 45 |
\fi} |
| 46 |
\fi |
| 47 |
|
| 48 |
\NewConfigure{color}{1} |
| 49 |
|
| 50 |
\newcommand\:settextcolor[2][]{{% |
| 51 |
\Configure{color}{\Configure{SetHColor}{\global\let\:currentcolor\HColor}}% |
| 52 |
\if\relax\detokenize{#1}\relax\color{#2}\else\color[#1]{#2}\fi% |
| 53 |
}} |
| 54 |
\def\:tempc#1#2#3{\protect\leavevmode{\protect\:settextcolor#1{#2}% |
| 55 |
\protect\a:textcolor#3\protect\b:textcolor}}% |
| 56 |
|
| 57 |
\HLet\@textcolor=\:tempc |
| 58 |
\NewConfigure{textcolor}{2} |
| 59 |
|
| 60 |
\def\pagecolor{% |
| 61 |
\begingroup \a:pagecolor |
| 62 |
\let\ignorespaces\endgroup |
| 63 |
\let\set@color\set@page@color |
| 64 |
\color} |
| 65 |
\NewConfigure{pagecolor}{1} |
| 66 |
\def\:tempa[#1]#2{\a:color{#1 #2}\o:@undeclaredcolor:[#1]{#2}} |
| 67 |
\HLet\@undeclaredcolor\:tempa |
| 68 |
\pend:defI\@declaredcolor{\a:color{##1}} |
| 69 |
\NewConfigure{SetHColor}[2]{{% |
| 70 |
\expandafter\let\expandafter\:temp \csname CLR:#2\endcsname |
| 71 |
\ifx \:temp\relax |
| 72 |
\edef\:temp{#2 //}\expandafter\get:HColor\:temp |
| 73 |
\ifx \HColor\relax |
| 74 |
\expandafter\ifx \csname get!HColor\endcsname\relax \else |
| 75 |
\edef\:temp{#2!//}\expandafter\csname get!HColor\expandafter\endcsname\:temp |
| 76 |
\fi |
| 77 |
% |
| 78 |
\fi |
| 79 |
\else \let\HColor=\:temp \fi |
| 80 |
\ifx \HColor\relax |
| 81 |
\:warning{missing \string\Configure{HColor}{#2}{...} |
| 82 |
(in LaTeX: \csname\string\color @#2\endcsname)}% |
| 83 |
\expandafter\global\expandafter\let\csname CLR:#2\endcsname\empty |
| 84 |
\else #1\fi }} |
| 85 |
\def\get:HColor#1 #2//{% |
| 86 |
\if\relax#2\relax |
| 87 |
% \expandafter\ifx \csname HColor:#1\endcsname\relax |
| 88 |
\let\HColor=\relax |
| 89 |
\expandafter\ifx \csname\string\color @#1\endcsname \relax\else |
| 90 |
\expandafter\ifx \csname colortyp:\endcsname\relax \else |
| 91 |
\csname colortyp:\expandafter\expandafter\expandafter\endcsname |
| 92 |
\csname\string\color @#1\expandafter\endcsname |
| 93 |
\space . //% |
| 94 |
\fi \fi |
| 95 |
% |
| 96 |
\else |
| 97 |
\csname HColor:#1\endcsname #2 //% |
| 98 |
\fi |
| 99 |
} |
| 100 |
\def\c:HColor:gray:{\def\HColor:gray##1 ##2//} |
| 101 |
\Configure{HColor:gray}{\Configure{HColor}{}{}} |
| 102 |
\def\c:HColor:rgb:{\def\HColor:rgb##1,##2,##3 ##4//} |
| 103 |
\Configure{HColor:rgb}{\Configure{HColor}{}{}} |
| 104 |
\def\c:HColor:cmyk:{\def\HColor:cmyk##1,##2,##3,##4 ##5//} |
| 105 |
\Configure{HColor:cmyk}{\Configure{HColor}{}{}} |
| 106 |
|
| 107 |
\long\def\:temp#1#2#3{% |
| 108 |
\ifcolors@ |
| 109 |
\def\:temp{#1}\def\:tempa{\relax}\ifx\:temp\:tempa |
| 110 |
\a:colorbox \else \a:fcolorbox \fi |
| 111 |
\fi |
| 112 |
{#1{\leavevmode #2{\set@color#3}}}% |
| 113 |
\ifcolors@ |
| 114 |
\def\:temp{#1}\def\:tempa{\relax}\ifx\:temp\:tempa |
| 115 |
\b:colorbox \else \b:fcolorbox \fi |
| 116 |
\fi |
| 117 |
} |
| 118 |
\HLet\color@b@x\:temp |
| 119 |
\NewConfigure{colorbox}{2} |
| 120 |
\NewConfigure{fcolorbox}{2} |
| 121 |
|
| 122 |
\HLet\mathcolor\textcolor |
| 123 |
|
| 124 |
\Hinput{color} |
| 125 |
\endinput |
| 126 |
|