Fix known issue with beamercolortheme fly

Previously `\plain` slides were broken if the user overrode the colour theme with `fly`, as that theme does not define a background colour for `palette primary`. The solution checks whether `palette primary.bg` is undefined; if so, it automatically picks a colour complementary to `palette primary.fg` for the background of the plain slides.
This commit is contained in:
Ross Churchley 2016-02-21 21:57:37 -08:00
parent 653826403e
commit 3f6e0c936b
2 changed files with 10 additions and 6 deletions

View File

@ -523,9 +523,6 @@ only alphabetic characters and do not require the expansion of any macros.
\subsection{Plain Frame}
The |\plain| command does not work if you override the \themename color theme
with the default beamer color theme |fly|.

View File

@ -177,9 +177,16 @@
\def\metropolis@plaintitleformat#1{#1}
\newcommand{\plain}[2][]{%
\begingroup
\setbeamercolor{background canvas}{
use=palette primary,
parent=palette primary
\ifbeamercolorempty[bg]{palette primary}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=-palette primary.fg
}
}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=palette primary.bg
}
}
\begin{frame}[c]{#1}
\begin{center}