0

Say I want to draw a beamercolorbox and have it be coloured with the colour used for block body alerted.bg. How can I do this? I read this question, but it turned out to be unhelpful. I need to somehow reference the colour by name. So I'd like something like this

\begin{beamercolorbox}[center,wd=\paperwidth]{block body.fg}
   <content>
\end{beamercolorbox}

But that does not work. Judging from fruitless googling there seems to be no easy way to directly use the template-defined colour to stay consistent, is there?

oarfish
  • 1,419

2 Answers2

1

It sounds like you want to invert a colour?

\documentclass{beamer}

\setbeamercolor{invert block body alerted}{fg=block body alerted.bg, bg=block body alerted.fg}

\begin{document}

    \begin{frame}

\begin{beamercolorbox}[center,wd=\paperwidth]{block body alerted}
    blub
\end{beamercolorbox}

\begin{beamercolorbox}[center,wd=\paperwidth]{invert block body alerted}
    blub
\end{beamercolorbox}        

    \end{frame}

\end{document}
  • No, I do not. The question is merely how to reference template-defined colours by name for use in arbitrary places. But \begin{beamercolorbox}[center,wd=\paperwidth]{block body alerted}... does what I want, somehow I did not realise this actually works. – oarfish Dec 06 '15 at 06:25
0

I didn't realise you can just call them by their names, i.e.

\begin{beamercolorbox}[center,wd=\paperwidth]{block body}
   <content>
\end{beamercolorbox}

but apparently, you cannot reference background or foreground colours like this.

oarfish
  • 1,419