Document Classesbeamer | Change Color of Block

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

beamer | Change Color of Block

Post by paulosousa »

Hello,

with the following I have two blocks with same color

Code: Select all

\documentclass{beamer}
\usetheme{Warsaw}

\begin{document}

\begin{frame}
\setbeamercolor{block title}{use=structure,fg=white,bg=purple!75!black}
\setbeamercolor{block body}{use=structure,fg=black,bg=white!20!white}

\begin{block}{title 1}
...
\end{block}

\begin{block}{title 2}
...
\end{block}
\end{frame}

\end{document}
But I need the second one with the title=black and body=white
the first block with the colors of the example

How I must do this change?

regards,
Paulo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

beamer | Change Color of Block

Post by Stefan Kottwitz »

You can change colors also within a frame.

Code: Select all

\begin{frame}
\setbeamercolor{block title}{use=structure,fg=white,bg=purple!75!black}
\setbeamercolor{block body}{use=structure,fg=black,bg=white!20!white}

\begin{block}{title 1}
...
\end{block}

\setbeamercolor{block title}{use=structure,fg=black,bg=purple!75!black}
\setbeamercolor{block body}{use=structure,fg=white,bg=white!20!white}

\begin{block}{title 2}
...
\end{block}
\end{frame}
beamer-block-colors.png
beamer-block-colors.png (3 KiB) Viewed 64658 times
Stefan
LaTeX.org admin
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

Re: beamer | Change Color of Block

Post by paulosousa »

Thank you very much, simple solution, worked perfectly.
Post Reply