Debian Codegraph @

texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty

raw
1 %%
2 %% This is file `lwarp-xcolor.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `xcolor')
8 %% This is a generated file.
9 %% Copyright 2016-2026 Brian Dunn
10 %%
11 %% This work may be distributed and/or modified under the
12 %% conditions of the LaTeX Project Public License, either version 1.3
13 %% of this license or (at your option) any later version.
14 %% The latest version of this license is in
15 %% http://www.latex-project.org/lppl.txt
16 %% and version 1.3 or later is part of all distributions of LaTeX
17 %% version 2005/12/01 or later.
18
19
20
21 \LWR@ProvidesPackagePass{xcolor}[2023-11-15]
22
23 \let\color@endgroup\endgroup
24
25 \LetLtxMacro\LWR@print@pagecolor\pagecolor
26 \LetLtxMacro\LWR@print@nopagecolor\nopagecolor
27 \appto\LWR@restoreorigformatting{%
28 \LetLtxMacro\pagecolor\LWR@print@pagecolor%
29 \LetLtxMacro\nopagecolor\LWR@print@nopagecolor%
30 }
31 \DeclareRobustCommand{\LWR@HTML@normalcolor}{\color{black}}%
32
33 \LWR@formatted{normalcolor}
34 \renewcommand*{\LWR@findcurrenttextcolor}{%
35 \LWR@traceinfo{LWR@findcurrenttextcolor}%
36 \protect\colorlet{LWR@current@color}{.}%
37 \LWR@traceinfo{LWR@findcurrenttextcolor B}%
38 \protect\convertcolorspec{named}{LWR@current@color}{HTML}\LWR@tempcolor\relax%
39 \LWR@traceinfo{LWR@findcurrenttextcolor: done}%
40 }
41 \DeclareDocumentCommand{\LWR@textcurrentcolor}{m}{%
42 \begingroup%
43 \LWR@hook@processingtags%
44 \LWR@findcurrenttextcolor%
45 \InlineClass[color:\LWR@origpound\LWR@tempcolor]{textcolor}{%
46 \renewcommand*{\LWR@currenttextcolor}{\LWR@origpound\LWR@tempcolor}%
47 #1%
48 }%
49 \endgroup%
50 }
51 \NewDocumentCommand{\LWR@colorstyle}{m m}{%
52 \begingroup%
53 \LWR@hook@processingtags%
54 \convertcolorspec{#1}{#2}{HTML}\LWR@tempcolor%
55 \LWR@origpound\LWR@tempcolor%
56 \endgroup%
57 }
58 \NewDocumentCommand{\LWR@backgroundcolor}{O{named} m m}{%
59 \begingroup%
60 \LWR@hook@processingtags%
61 \InlineClass[background:\LWR@colorstyle{#1}{#2}]{backgroundcolor}{%
62 #3%
63 }%
64 \endgroup%
65 }
66 \newcommand*{\LWR@borderpadding}[2]{%
67 border:\LWR@printlength{\LWR@atleastonept} solid \LWR@colorstyle{#1}{#2} ; %
68 padding:\LWR@printlength{\fboxsep}%
69 }
70 \NewDocumentCommand{\LWR@HTML@color}{o m}{%
71 \IfValueTF{#1}{%
72 \LWR@print@color[#1]{#2}%
73 \convertcolorspec{#1}{#2}{HTML}\LWR@tempcolor%
74 }{%
75 \LWR@print@color{#2}%
76 \convertcolorspec{named}{#2}{HTML}\LWR@tempcolor%
77 }%
78 \edef\LWR@currenttextcolor{\LWR@origpound\LWR@tempcolor}%
79 }
80
81 \LWR@formatted{color}
82 \NewDocumentCommand{\LWR@HTML@textcolor}{o m m}{%
83 \begingroup%
84 \LWR@hook@processingtags%
85 \IfValueTF{#1}{%
86 \color[#1]{#2}%
87 }{%
88 \color{#2}%
89 }%
90 \InlineClass[color:\LWR@currenttextcolor]{textcolor}{#3}%
91 \endgroup%
92 }%
93
94 \LWR@formatted{textcolor}
95
96 \renewcommand*{\pagecolor}[2][named]{}
97
98 \renewcommand*{\nopagecolor}{}
99
100 \NewDocumentCommand{\LWR@HTML@colorbox}{O{named} m +m}{%
101 \begingroup%
102 \LWR@hook@processingtags%
103 \InlineClass[%
104 background:\LWR@colorstyle{#1}{#2} ; %
105 padding:\LWR@printlength{\fboxsep}%
106 ]{colorbox}{#3}%
107 \endgroup%
108 }
109
110 \NewDocumentCommand{\LWR@HTML@colorboxBlock}{O{named} m +m}{%
111 \begingroup%
112 \LWR@hook@processingtags%
113 \LWR@stoppars%
114 \begin{BlockClass}[%
115 background:\LWR@colorstyle{#1}{#2} ; %
116 padding:\LWR@printlength{\fboxsep}%
117 ]{colorboxBlock}
118 #3
119 \end{BlockClass}%
120 \endgroup%
121 \global\booltrue{LWR@minipagethispar}%
122 }
123
124 \NewDocumentCommand{\LWR@HTML@fcolorbox}{O{named} m O{#1} m +m}{%
125 \LWR@traceinfo{HTML fcolorbox #2 #4}%
126 \begingroup%
127 \LWR@hook@processingtags%
128 \LWR@forceminwidth{\fboxrule}%
129 \ifthenelse{\equal{#4}{none}}%
130 {% no background color
131 \InlineClass[%
132 \LWR@borderpadding{#1}{#2}%
133 ]{fcolorbox}{#5}%
134 }%
135 {% yes background color
136 \InlineClass[%
137 \LWR@borderpadding{#1}{#2} ; %
138 background:\LWR@colorstyle{#3}{#4}%
139 ]{fcolorbox}{#5}%
140 }%
141 \endgroup%
142 }
143
144 \NewDocumentCommand{\LWR@HTML@fcolorboxBlock}{O{named} m O{#1} m +m d()}{%
145 \LWR@traceinfo{HTML fcolorboxBlock #2 #4}%
146 \begingroup%
147 \LWR@hook@processingtags%
148 \LWR@forceminwidth{\fboxrule}%
149 \LWR@stoppars%
150 \ifthenelse{\equal{#4}{none}}%
151 {% no background color
152 \begin{BlockClass}[%
153 \LWR@borderpadding{#1}{#2}%
154 \IfValueT{#6}{ ; #6}%
155 ]{fcolorboxBlock}
156 #5
157 \end{BlockClass}%
158 }%
159 {% yes background color
160 \convertcolorspec{#3}{#4}{HTML}\LWR@tempcolortwo%
161 \begin{BlockClass}[%
162 background:\LWR@origpound\LWR@tempcolortwo\ ; %
163 \LWR@borderpadding{#1}{#2}%
164 \IfValueT{#6}{ ; #6}%
165 ]{fcolorboxBlock}
166 #5
167 \end{BlockClass}%
168 }%
169 \endgroup%
170 \global\booltrue{LWR@minipagethispar}%
171 \LWR@traceinfo{HTML fcolorboxBlock done}%
172 }
173
174 \NewDocumentCommand{\LWR@subfcolorminipage}{m m m m}{%
175 \LWR@stoppars%
176 \begin{BlockClass}[%
177 #3%
178 \LWR@borderpadding{#1}{#2} ; %
179 \IfValueT{#4}{height:\LWR@printlength{\LWR@tempheight} ; }%
180 width:\LWR@printlength{\LWR@tempwidth}%
181 ]{fcolorminipage}%
182 }
183 \NewDocumentEnvironment{LWR@HTML@fcolorminipage}{O{named} m O{#1} m O{c} o o m}
184 {%
185 \LWR@hook@processingtags%
186 \setlength{\LWR@tempwidth}{#8}%
187 \IfValueT{#6}{\setlength{\LWR@tempheight}{#6}}%
188 \LWR@forceminwidth{\fboxrule}%
189 \convertcolorspec{#1}{#2}{HTML}\LWR@tempcolor%
190 \ifthenelse{\equal{#4}{none}}%
191 {\LWR@subfcolorminipage{#1}{#2}{}{#6}}%
192 {%
193 \convertcolorspec{#3}{#4}{HTML}\LWR@tempcolortwo%
194 \LWR@subfcolorminipage{#1}{#2}%
195 {background:\LWR@origpound\LWR@tempcolortwo\ ; }%
196 {#6}%
197 }%
198 }%
199 {%
200 \end{BlockClass}%
201 \global\booltrue{LWR@minipagethispar}%
202 }
203 \newcommand*{\LWR@HTML@boxframe}[3]{%
204 {%
205 \setlength{\LWR@tempwidth}{#1}%
206 \setlength{\LWR@tempheight}{#2}%
207 \addtolength{\LWR@tempheight}{#3}%
208 \LWR@forceminwidth{\fboxrule}%
209 \LWR@findcurrenttextcolor%
210 \InlineClass[%
211 display:inline-block ; %
212 border:%
213 \LWR@printlength{\LWR@atleastonept} % space
214 solid % space
215 \LWR@currenttextcolor{} ; % space
216 width:\LWR@printlength{\LWR@tempwidth} ; %
217 height:\LWR@printlength{\LWR@tempheight}%
218 ]{boxframe}{}%
219 }%
220 }
221
222 \LWR@formatted{boxframe}
223 \endinput
224 %%
225 %% End of file `lwarp-xcolor.sty'.