| 1 |
% \iffalse meta-comment ------------------------------------------------------- |
| 2 |
% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of |
| 3 |
% contributors can be found at |
| 4 |
% |
| 5 |
% https://github.com/matze/mtheme/graphs/contributors |
| 6 |
% |
| 7 |
% and the original template was based on the HSRM theme by Benjamin Weiss. |
| 8 |
% |
| 9 |
% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 |
| 10 |
% International License (https://creativecommons.org/licenses/by-sa/4.0/). |
| 11 |
% ------------------------------------------------------------------------- \fi |
| 12 |
% \iffalse |
| 13 |
%<*package> |
| 14 |
\NeedsTeXFormat{LaTeX2e} |
| 15 |
\ProvidesPackage{beamercolorthememetropolis}[2017/01/23 Metropolis color theme] |
| 16 |
%</package> |
| 17 |
% \fi |
| 18 |
% \CheckSum{0} |
| 19 |
% \StopEventually{} |
| 20 |
% \iffalse |
| 21 |
%<*package> |
| 22 |
% ------------------------------------------------------------------------- \fi |
| 23 |
% |
| 24 |
% \subsection{\themename color theme} |
| 25 |
% |
| 26 |
% |
| 27 |
% |
| 28 |
% \subsubsection{Package dependencies} |
| 29 |
% \begin{macrocode} |
| 30 |
\RequirePackage{pgfopts} |
| 31 |
% \end{macrocode} |
| 32 |
% |
| 33 |
% |
| 34 |
% |
| 35 |
% \subsubsection{Options} |
| 36 |
% |
| 37 |
% \begin{macro}{block} |
| 38 |
% Optionally adds a light grey background to block environments like |
| 39 |
% |theorem| and |example|. |
| 40 |
% \begin{macrocode} |
| 41 |
\pgfkeys{ |
| 42 |
/metropolis/color/block/.cd, |
| 43 |
.is choice, |
| 44 |
transparent/.code=\metropolis@block@transparent, |
| 45 |
fill/.code=\metropolis@block@fill, |
| 46 |
} |
| 47 |
% \end{macrocode} |
| 48 |
% \end{macro} |
| 49 |
% |
| 50 |
% \begin{macro}{colors} |
| 51 |
% Provides the option to have a dark background and light foreground instead |
| 52 |
% of the reverse. |
| 53 |
% \begin{macrocode} |
| 54 |
\pgfkeys{ |
| 55 |
/metropolis/color/background/.cd, |
| 56 |
.is choice, |
| 57 |
dark/.code=\metropolis@colors@dark, |
| 58 |
light/.code=\metropolis@colors@light, |
| 59 |
} |
| 60 |
% \end{macrocode} |
| 61 |
% \end{macro} |
| 62 |
% |
| 63 |
% \begin{macro}{\metropolis@color@setdefaults} |
| 64 |
% Sets default values for color theme options. |
| 65 |
% \begin{macrocode} |
| 66 |
\newcommand{\metropolis@color@setdefaults}{ |
| 67 |
\pgfkeys{/metropolis/color/.cd, |
| 68 |
background=light, |
| 69 |
block=transparent, |
| 70 |
} |
| 71 |
} |
| 72 |
% \end{macrocode} |
| 73 |
% \end{macro} |
| 74 |
% |
| 75 |
% |
| 76 |
% |
| 77 |
% \subsubsection{Base colors} |
| 78 |
% |
| 79 |
% \begin{macrocode} |
| 80 |
\definecolor{mDarkBrown}{HTML}{604c38} |
| 81 |
\definecolor{mDarkTeal}{HTML}{23373b} |
| 82 |
\definecolor{mLightBrown}{HTML}{EB811B} |
| 83 |
\definecolor{mLightGreen}{HTML}{14B03D} |
| 84 |
% \end{macrocode} |
| 85 |
% |
| 86 |
% |
| 87 |
% |
| 88 |
% \subsubsection{Base styles} |
| 89 |
% |
| 90 |
% All colors in \themename are derived from the definitions of |normal text|, |
| 91 |
% |alerted text|, and |example text|. |
| 92 |
% |
| 93 |
% \begin{macrocode} |
| 94 |
\newcommand{\metropolis@colors@dark}{ |
| 95 |
\setbeamercolor{normal text}{% |
| 96 |
fg=black!2, |
| 97 |
bg=mDarkTeal |
| 98 |
} |
| 99 |
\usebeamercolor[fg]{normal text} |
| 100 |
} |
| 101 |
\newcommand{\metropolis@colors@light}{ |
| 102 |
\setbeamercolor{normal text}{% |
| 103 |
fg=mDarkTeal, |
| 104 |
bg=black!2 |
| 105 |
} |
| 106 |
} |
| 107 |
\setbeamercolor{alerted text}{% |
| 108 |
fg=mLightBrown |
| 109 |
} |
| 110 |
\setbeamercolor{example text}{% |
| 111 |
fg=mLightGreen |
| 112 |
} |
| 113 |
% \end{macrocode} |
| 114 |
% |
| 115 |
% |
| 116 |
% |
| 117 |
% \subsubsection{Derived colors} |
| 118 |
% |
| 119 |
% The titles and structural elements (e.g. |itemize| bullets) are set in the |
| 120 |
% same color as |normal text|. This would ideally done by setting |normal text| |
| 121 |
% as a parent style, which we do to set |titlelike|, but this doesn't work for |
| 122 |
% |structure| as its foreground is set explicitly in |
| 123 |
% |beamercolorthemedefault.sty|. |
| 124 |
% |
| 125 |
% \begin{macrocode} |
| 126 |
\setbeamercolor{titlelike}{use=normal text, parent=normal text} |
| 127 |
\setbeamercolor{author}{use=normal text, parent=normal text} |
| 128 |
\setbeamercolor{date}{use=normal text, parent=normal text} |
| 129 |
\setbeamercolor{institute}{use=normal text, parent=normal text} |
| 130 |
\setbeamercolor{structure}{use=normal text, fg=normal text.fg} |
| 131 |
% \end{macrocode} |
| 132 |
% |
| 133 |
% The “primary” palette should be used for the most important navigational |
| 134 |
% elements, and possibly of other elements. \themename uses it for frame |
| 135 |
% titles and slides. |
| 136 |
% |
| 137 |
% \begin{macrocode} |
| 138 |
\setbeamercolor{palette primary}{% |
| 139 |
use=normal text, |
| 140 |
fg=normal text.bg, |
| 141 |
bg=normal text.fg |
| 142 |
} |
| 143 |
\setbeamercolor{frametitle}{% |
| 144 |
use=palette primary, |
| 145 |
parent=palette primary |
| 146 |
} |
| 147 |
% \end{macrocode} |
| 148 |
% |
| 149 |
% The \themename inner or outer themes optionally display progress |
| 150 |
% bars in various locations. Their color is set by |progress bar| but the two |
| 151 |
% different kinds can be customized separately. The horizontal rule on the |
| 152 |
% title page is also set based on the progress bar color and can be customized |
| 153 |
% with |title separator|. |
| 154 |
% |
| 155 |
% \begin{macrocode} |
| 156 |
\setbeamercolor{progress bar}{% |
| 157 |
use=alerted text, |
| 158 |
fg=alerted text.fg, |
| 159 |
bg=alerted text.fg!50!black!30 |
| 160 |
} |
| 161 |
\setbeamercolor{title separator}{ |
| 162 |
use=progress bar, |
| 163 |
parent=progress bar |
| 164 |
} |
| 165 |
\setbeamercolor{progress bar in head/foot}{% |
| 166 |
use=progress bar, |
| 167 |
parent=progress bar |
| 168 |
} |
| 169 |
\setbeamercolor{progress bar in section page}{ |
| 170 |
use=progress bar, |
| 171 |
parent=progress bar |
| 172 |
} |
| 173 |
% \end{macrocode} |
| 174 |
% |
| 175 |
% Block environments such as |theorem| and |example| have no background color |
| 176 |
% by default. The option |block=fill| sets a background color based on the |
| 177 |
% background and foreground of |normal text|. The option |block=transparent| |
| 178 |
% reverts the block environments to an empty background, which can be useful |
| 179 |
% if changing colors mid-presentation. |
| 180 |
% |
| 181 |
% \begin{macrocode} |
| 182 |
\newcommand{\metropolis@block@transparent}{ |
| 183 |
\setbeamercolor{block title}{% |
| 184 |
use=normal text, |
| 185 |
fg=normal text.fg, |
| 186 |
bg= |
| 187 |
} |
| 188 |
\setbeamercolor{block body}{ |
| 189 |
bg= |
| 190 |
} |
| 191 |
} |
| 192 |
\newcommand{\metropolis@block@fill}{ |
| 193 |
\setbeamercolor{block title}{% |
| 194 |
use=normal text, |
| 195 |
fg=normal text.fg, |
| 196 |
bg=normal text.bg!80!fg |
| 197 |
} |
| 198 |
\setbeamercolor{block body}{ |
| 199 |
use={block title, normal text}, |
| 200 |
bg=block title.bg!50!normal text.bg |
| 201 |
} |
| 202 |
} |
| 203 |
\setbeamercolor{block title alerted}{% |
| 204 |
use={block title, alerted text}, |
| 205 |
bg=block title.bg, |
| 206 |
fg=alerted text.fg |
| 207 |
} |
| 208 |
\setbeamercolor{block title example}{% |
| 209 |
use={block title, example text}, |
| 210 |
bg=block title.bg, |
| 211 |
fg=example text.fg |
| 212 |
} |
| 213 |
\setbeamercolor{block body alerted}{use=block body, parent=block body} |
| 214 |
\setbeamercolor{block body example}{use=block body, parent=block body} |
| 215 |
% \end{macrocode} |
| 216 |
% |
| 217 |
% Footnotes |
| 218 |
% |
| 219 |
% \begin{macrocode} |
| 220 |
\setbeamercolor{footnote}{fg=normal text.fg!90} |
| 221 |
\setbeamercolor{footnote mark}{fg=.} |
| 222 |
% \end{macrocode} |
| 223 |
% |
| 224 |
% |
| 225 |
% |
| 226 |
% \subsubsection{Process package options} |
| 227 |
% |
| 228 |
% \begin{macrocode} |
| 229 |
\metropolis@color@setdefaults |
| 230 |
\ProcessPgfPackageOptions{/metropolis/color} |
| 231 |
% \end{macrocode} |
| 232 |
% |
| 233 |
% \begin{macrocode} |
| 234 |
\mode<all> |
| 235 |
% \end{macrocode} |
| 236 |
% |
| 237 |
% \iffalse |
| 238 |
%</package> |
| 239 |
% \fi |
| 240 |
% \Finale |
| 241 |
\endinput |