Debian Codegraph @

texmf-dist/tex/generic/tex4ht/colortbl-hooks.4ht

raw
1 % colortbl-hooks.4ht (2024-09-30-13:40), generated from tex4ht-4ht.tex
2 % Copyright 2024 TeX Users Group
3 %
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either
6 % version 1.3c of this license or (at your option) any
7 % later version. The latest version of this license is in
8 % http://www.latex-project.org/lppl.txt
9 % and version 1.3c or later is part of all distributions
10 % of LaTeX version 2005/12/01 or later.
11 %
12 % This work has the LPPL maintenance status "maintained".
13 %
14 % The Current Maintainer of this work
15 % is the TeX4ht Project <http://tug.org/tex4ht>.
16 %
17 % If you modify this program, changing the
18 % version identification would be appreciated.
19 \immediate\write-1{version 2024-09-30-13:40}
20
21 \:AtEndOfPackage{%
22 % default hline color is black
23 \def\hline:color{000}
24 % save rule color in format usable in CSS
25 \newcommand\tmp:arrayrulecolor[2][named]{%
26 \ifvoid\@arstrutbox% test if we are inside a tabular environment
27 \convertcolorspec{#1}{#2}{HTML}\:tmp\global\let\hline:color\:tmp% we are not
28 \else%
29 \noalign{\convertcolorspec{#1}{#2}{HTML}\:tmp\global\let\hline:color\:tmp}% we are
30 \fi
31 }
32 % \HLet doesn't work in the preamble, so we need to work around it
33 \let\o:arrayrulecolor:\arrayrulecolor
34 \let\arrayrulecolor\tmp:arrayrulecolor
35
36 \def\convert:colorspec#1 #2 #3 #4{%
37 \edef\current:color{%
38 \ifx\relax#1\relax\else%
39 #1\ifx\relax#2\relax\else%
40 , #2\ifx\relax#3\relax\else%
41 , #3\ifx\relax#4\relax\else%
42 , #4%
43 \fi%
44 \fi%
45 \fi%
46 \fi%
47 }%
48 }
49
50
51 }
52