# Beamer: How to set background color only on title page in theme

I'm developing a Beamer theme and I want to make the background color of the title page one color and all the other slides to have a different color.

I've found that I can change the background color for a slide using:

\setbeamercolor{background canvas}{bg=violet}


I want to do this in the beamer theme style file, not in the latex document and I couldn't figure out how to do that.

I know I can change the background color on slide 1 like this:

\setbeamertemplate{background}{%
\begin{tikzpicture}[background rectangle/.style={fill=blue}, show background rectangle]
\hspace*{20em}
\node[opacity=0.45, scale=5.6]{\includegraphics{background}};
\end{tikzpicture}
\else%
\begin{tikzpicture}[background rectangle/.style={fill=white}, show background rectangle]
\hspace*{20em}
\node[opacity=0.09, scale=5.6]{\includegraphics{background}};
\end{tikzpicture}
\fi%


This works if the title slide is the first slide---almost always the case. It does not work if putting multiple title slides in the same file, which I do on occasion.

Here is what I'm trying to accomplish. In this example, I'm using the excellent Metropolis theme. This example shows that I can have two different title slides in the same presentation. It does not show that there is a different background color in the title slide. Of course, I want to implement this in my own theme. (I'm sorry that I can't share all of my style file.)

\documentclass{beamer}

\usetheme{metropolis}

\begin{document}
\title{First Title}
\begin{frame}
\maketitle
\end{frame}

\begin{frame}{Some title}
Some content here
\end{frame}

\title{Second Title}
\begin{frame}
\maketitle
\end{frame}

\end{document}


• Can you provide a basic minimal document, say one with a single title slide, and one with multiple slides (or non-first-slide) so the community can work with that information?
– Werner
Oct 25, 2021 at 16:40
• @Werner I've uploaded an example of using two title slides in the same presentation. I hope this helps! Oct 25, 2021 at 16:57

You can add a tikzpicture to the title page template that draws the background directly use the coordinates of the current page:

## beamerthememytheme.sty

\usetheme{metropolis}

\usetikzlibrary{backgrounds}

\begin{tikzpicture}[remember picture, overlay]
\draw[fill=violet!20!white] (current page.south west) rectangle
(current page.north east);
\end{tikzpicture}%
}{}


## main file

\documentclass{beamer}

\usetheme{mytheme}

\begin{document}
\title{First Title}
\begin{frame}
\maketitle
\end{frame}

\begin{frame}{Some title}
Some content here
\end{frame}

\title{Second Title}
\begin{frame}
\maketitle
\end{frame}

\end{document}