Using \setbeamercolor{background canvas}{bg=black}
works fine if I want to change the background color. However once I used \setbeamertemplate{background canvas}{}
it doesn't work anymore:
\documentclass{beamer}
\begin{document}
% as expected
\begin{frame}{Test}
white
\end{frame}
\setbeamercolor{background canvas}{bg=black}
\begin{frame}{Test}
\textcolor{white}{black}
\end{frame}
\setbeamercolor{background canvas}{bg=}
\begin{frame}{Test}
white again
\end{frame}
% confusing
\setbeamertemplate{background canvas}{}
\setbeamercolor{background canvas}{bg=black}
\begin{frame}{Test}
should be black
\end{frame}
\end{document}
EDIT: Why do I do this?
I sometimes use a code like this
\setbeamertemplate{background canvas}{\includegraphics[width=\paperwidth]{picture.jpg}}
to use a picture to fill the background. I clear the picture by using
\setbeamertemplate{background canvas}{}
How else could I clear the picture?
Ok:
Ok:
Ok:
Here's the mistake:
Any ideas?
Best Answer
Andrew Swann's answer explains why this happens but I thought you might find it useful to see what you might want to do instead. I'm not sure what you are trying to achieve by setting the template to empty but it may be that you really just wanted to eliminate the headline/footline etc. so that the entire area of the slide was available for content. I've therefore modified your example a little to show some of the possibilities: