add tag
Trevor
Using the `tcolorbox` package is there any way to make a horizontally striped box with stripes of equal width? Something like this for example:

![striped.png](/image?hash=febbca331c25ac7cb87fc120a45493d8aaf07f2c078a57fa6e33c999e05f725a)

This is the best I've been able to come up with:
```
\documentclass{article}

\usepackage{tcolorbox}
\tcbuselibrary{skins, raster}

\begin{document}

\begin{tcbraster}[tile,colback=blue,colbacklower=red]
\begin{tcolorbox}
hello
\tcblower
world
\end{tcolorbox}
\end{tcbraster}

\end{document}
```
But this only makes two stripes, and depending on the length of the text, the stripes will not necessarily be of equal width. I checked the `tcolorbox` manual but couldn't seemed to find a solution.
Top Answer
marmot
With `underlay` you can achieve pretty much any background. Here is an example.
```
\documentclass{article}

\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usetikzlibrary{calc}
\begin{document}

\begin{tcolorbox}[enhanced,colback=blue,
coltext=white,fontupper=\sffamily\bfseries,
underlay={\begin{tcbclipinterior}
\fill[red] let \p1=($(interior.north)-(interior.south)$) in
{foreach \X in {1,2,3}
{([yshift={(2*\X-2)*\y1/6}]interior.south west) rectangle 
([yshift={(2*\X-1)*\y1/6}]interior.south east)}};
\end{tcbclipinterior}}]
world
\end{tcolorbox}

\end{document}
```
![Screen Shot 2020-11-12 at 10.04.42 PM.png](/image?hash=66f8d0cc38b19362a5deeb931f4756e1531e217aeeb3833eee0fcb780abbf5af)

Obviously you can make this a style, vary the number of stripes and so on and so forth.
```
\documentclass{article}

\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usetikzlibrary{calc}
\tcbset{blue-red stripes/.style={colback=blue,
underlay={\begin{tcbclipinterior}
\fill[red] let \p1=($(interior.north)-(interior.south)$) in
{foreach \X in {1,...,#1}
{([yshift={(2*\X-2)*\y1/#1/2}]interior.south west) rectangle 
([yshift={(2*\X-1)*\y1/#1/2}]interior.south east)}};
\end{tcbclipinterior}}},blue-red stripes/.default=3}
\begin{document}

\begin{tcolorbox}[enhanced,coltext=white,hbox,
fontupper=\sffamily\bfseries,blue-red stripes=2]
hello world
\end{tcolorbox}

\end{document}
```
![Screen Shot 2020-11-12 at 10.08.51 PM.png](/image?hash=6fa9e99f88c32e396984c5924b8c4e10354f294a7581a701fa685faf7fe376f7)

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.