Section 17.2.2 “Using Beamer’s Colors” of the Beamer manual describes how to use preset colors: The command \usebeamercolor[fg]{<beamer color name>}
and \usebeamercolor[bg]{<beamer color name>}
set the current color to the foreground resp. background color given by beamer color name
. Typical values for beamer color name
are normal text
, structure
or alerted text
Of specific interest for you are probably the palette colors (see section 17.4 of the manual) palette primary
to palette quaternary
and palette sidebar primary
, etc. Themes are typically based on these colors.
You can also have a look at the beamer/themes/color/beamercolortheme*.sty
files (in the beamer installation dir, usually under $TEXMF/tex/latex/
) to see what colors are typically defined by a color theme.
(All section numbers refer to the beamer v3.10 manual.)
Having just wanted to do this in answer to another question, I can tell you that this is Not Intended To Be Done! A lot of the theming and colour commands are simply set to "do nothing" when the article
version of beamer is used. However, using a bit of trickery we can reload the commands and so make the colours available. This should be used with Extreme Caution as it might break something that I haven't tested (which is about everything).
Here's a picture based on a slightly modified version of your example:
And here's the code:
\documentclass{standalone}
%\url{http://tex.stackexchange.com/q/22768/86}
\PassOptionsToPackage{svgnames}{xcolor}
\usepackage{beamerarticle}
\usepackage{tikz}
\makeatletter
\def\beamer@currentmode{beamer}
\def\beamer@colorhook{}
\newskip\beamer@lastskip
\let\beamercolorbox=\relax
\let\endbeamercolorbox=\relax
\let\usetheme=\relax
\let\usecolortheme=\relax
\let\usefonttheme=\relax
\let\useoutertheme=\relax
\let\useinnertheme=\relax
\input{beamerbasethemes.sty}
\input{beamerbasecolor.sty}
\usecolortheme{default}
\usecolortheme{beaver}
\makeatother
\setbeamercolor{example text}{bg=Maroon}
\begin{document}
This is some text outside any frame.
\begin{frame}{Frame}
\begin{alertblock}{Block}
\usebeamercolor{example text}%
\begin{tikzpicture}
\filldraw[color=fg, fill=bg!50!white] (0,0) rectangle (5,3);
\draw[line width=5mm] (1,1)--(2,2);
\end{tikzpicture}
\end{alertblock}
\end{frame}
\end{document}
The main part is the stuff between \makeatletter
and \makeatother
. We need to load in the beamer colour management. Unfortunately, the file containing the commands checks the mode
and skips most stuff in article
mode. So we need to temporarily change to beamer
mode to persuade it that we really do want to define this stuff. But as the files have already been read in (via the \usepackage{beamerarticle}
) we can't \usepackage
them again but have to \input
them (this produces a couple of warnings in the log, but ignore them). We load in the themes
set and the color
set. There are a couple of things that are defined in beamer.cls
that these depend on so we have to set them up: \beamer@colorhook
and \beamer@lastskip
. Also, some things are defined by \newcommand
and were defined (to the wrong things) on the first read. So we need to set them all to \relax
to avoid errors. After that, it's plain sailing!
Best Answer
In the file
beamercolorthemedefault.sty
you can find the color definition:and the
structure
color is used, for example, in