Skip to content

Commit 35380b5

Browse files
committed
Enhance color tests to capture correct behaviour of \setbox and \box with respect to color and background color adjustment
1 parent 20fb2b3 commit 35380b5

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

t/graphics/xcolors.pdf

481 Bytes
Binary file not shown.

t/graphics/xcolors.tex

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,19 @@ \section{Color Compararisons}
246246
\end{testcolors}
247247
\endgroup
248248

249-
\section{Boxes}
249+
\section{Setting and Using Boxes}
250250
\newbox\mybox
251-
\setbox\mybox=\hbox{Should NOT be Red!}
251+
{\color{red}\global\setbox\mybox=\hbox{Black on White!}}
252+
\copy\mybox
253+
254+
\setbox\mybox=\hbox{{\color{black}\colorbox{white}{Black on White!}}}
252255
\copy\mybox
253-
\setbox\mybox=\hbox{Should be Red!}
254-
{\color{red}\copy\mybox}
256+
257+
\setbox\mybox=\hbox{Red on Green!}
258+
{\color{red}\colorbox{green}{\copy\mybox}}
259+
260+
\setbox\mybox=\hbox{Red on Green, but \color{green}\colorbox{blue}{Green on Blue!}}
261+
{\color{red}\colorbox{green}{\copy\mybox}}
255262

256263
\section{Custom rgb directives}
257264
\color{rgb:red,4;green,2;yellow,1} Brown

t/graphics/xcolors.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,18 @@ A=100*13 = 1300pt;</p>
642642
<tag role="refnum">11</tag>
643643
<tag role="typerefnum">§11</tag>
644644
</tags>
645-
<title><tag close=" ">11</tag>Boxes</title>
645+
<title><tag close=" ">11</tag>Setting and Using Boxes</title>
646646
<para xml:id="S11.p1">
647-
<p>Should NOT be Red!
648-
<text color="#FF0000">Should be Red!</text></p>
647+
<p>Black on White!</p>
648+
</para>
649+
<para xml:id="S11.p2">
650+
<p><text backgroundcolor="#FFFFFF" color="#000000">Black on White!</text></p>
651+
</para>
652+
<para xml:id="S11.p3">
653+
<p><text backgroundcolor="#00FF00" color="#FF0000">Red on Green!</text></p>
654+
</para>
655+
<para xml:id="S11.p4">
656+
<p><text backgroundcolor="#00FF00" color="#FF0000">Red on Green, but <text backgroundcolor="#0000FF" color="#00FF00">Green on Blue!</text></text></p>
649657
</para>
650658
</section>
651659
<section inlist="toc" xml:id="S12">

0 commit comments

Comments
 (0)