2

I have some Tikz-drawings in my beamer presentation and my background color is slightly off-white (it doesn't stress the eye as much as pure white does) but I still want some drawings to be "transparent".

Is there a way to access the beamer background color as set by

\setbeamercolor{background canvas}{bg=blanchedalmond!12}

such that I would be able to write \node[fill=\beamerBackgroundColor, ...]?

1 Answers1

3

The beamer manual says

enter image description here

This suggests that you can use

\usebeamercolor{background canvas}
\node[fill=bg] at (4,0) {from beamer};

i.e. after invoking

\usebeamercolor{background canvas}

the color named bg is the background color. Indeed,

\documentclass[svgnames]{beamer}
\usepackage{tikz}
\setbeamercolor{background canvas}{bg=BlanchedAlmond!12}
\begin{document}
\begin{frame}[t]
\frametitle{Beamer colors in Ti\emph{k}Z}
\centering
\begin{tikzpicture}
\fill[blue] (-2,-1) rectangle (6,2);
\node[fill=BlanchedAlmond!12]{by hand};
\usebeamercolor{background canvas}
\node[fill=bg] at (4,0) {from beamer};
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

Since this color is hard to distinguish from the background, here is another test with \setbeamercolor{background canvas}{bg=red}.

enter image description here

If you wish to get the actual color specifications, you may consult this thread.