[Tex/LaTex] Tikzposter: How to change the background of a \block

colortikzposter

I'm trying to obtain that the blocks on one half of the poster have, say, red background, and in the other half have, say, green background.

Is that possible?

Thanks

Best Answer

The background color of the blocks is blockbodybgcolor, so you can simply redefine that colour as you see fit in your document, using \colorlet{blockbodybgcolor}{<colorname>}. Similarly, the background color of the block title is blocktitlebgcolor, so you can change that as well, if you wish.

enter image description here

\documentclass[a2paper]{tikzposter}
\author{D. Ude}
\title{FooBar}
\begin{document}
\maketitle
\block{A}{This has the default colour}

\colorlet{blockbodybgcolor}{green!60}
\block{B}{This is green}
{ % start a group to keep the change of title background color local
\colorlet{blocktitlebgcolor}{red!60}
\block{C}{As is this, but the title has red background}
} % end that group

\colorlet{blockbodybgcolor}{cyan}
\block{D}{This is cyan}
\end{document}