[Tex/LaTex] Gradient background for Beamer slides

backgroundsbeamercolorgradienttikz-pgf

I'm trying to create a background gradient for a set of Beamer slides. This question seems to be doing more or less what I want but the answer does not work for me. If I paste the answer into a file I get this error:

! Undefined control sequence.
<recently read> \backgroundsetup 

l.4 \backgroundsetup
                    {
? x
No pages of output.
Transcript written on bg.log.

The linked question also doesn't do quite what I want because I would like the gradient to start in the center. I'm going for an effect like this.

I prefer answers using tikz since I have worked with that.

Best Answer

With beamer, you don’t need the background package, the \usebackgroundtemplate macro offers the possibility to set the background.

Code

\documentclass{beamer}
\usepackage{tikz}
\usebackgroundtemplate{
  \begin{tikzpicture}
    \path [outer color = green!20, inner color = blue!10]
      (0,0) rectangle (\paperwidth,\paperheight);
  \end{tikzpicture}}
\title{This is the title.}
\begin{document}
\maketitle
\end{document}