metropolis_theme/beamercolorthememetropolis.sty

157 lines
3.5 KiB
TeX

% Beamer mtheme
%
% Copyright 2014 Matthias Vogelgesang
% Licensed under CC-BY-SA 4.0 International.
%
\ProvidesPackage{beamercolorthememetropolis}
% Options
% =======
% Option: blockbg
% applies a gray background to blocks
\newif\if@beamer@metropolis@blockbg
\@beamer@metropolis@blockbgfalse
\DeclareOptionBeamer{blockbg}{
\@beamer@metropolis@blockbgtrue
}
% Option: ...
\DeclareOptionBeamer*{%
\PackageWarning{beamercolorthememetropolis}{Unknown option `\CurrentOption'}%
}
\ProcessOptionsBeamer
% Color definitions
% =================
%
% See http://paletton.com/#uid=7050t0kkJkJsntwoyp6gYgoddc4
%
\definecolor{mDarkBrown}{HTML}{604c38}
\definecolor{mDarkTeal}{HTML}{23373b}
\definecolor{mLightBrown}{HTML}{EB811B}
\definecolor{mLightGreen}{HTML}{14B03D}
% Base colors
% ===========
%
% The metropolis color theme is defined in terms of three fundamental styles:
%
% - normal text (dark fg, light bg)
% - alerted text (colored fg, should be visible against dark or light)
% - example text (colored fg, should be visible against dark or light)
%
% An easy way to customize the theme is to redefine these colors using
%
% \setbeamercolor{ ... }{ fg= ... , bg= ... }
%
% in your preamble.
%
\setbeamercolor{normal text}{%
fg=mDarkTeal,
bg=black!2
}
\setbeamercolor{alerted text}{%
fg=mLightBrown
}
\setbeamercolor{example text}{%
fg=mLightGreen
}
% Derived colors
% ==============
%
% These colors are all defined in terms of the above and will update their
% appearance if `normal text`, `alerted text`, or `example text` is customized.
%
% You may also redefine these in your preamble for greater control over the
% customization. Beamer colors not defined here are inherited from
% `beamercolorthemedefault.sty`
%
% Reset titles and structure to normal text
\setbeamercolor{titlelike}{use=normal text, parent=normal text}
\setbeamercolor{structure}{%
% This would be parent=normal text, but the inheritance is overriden by the
% explicity color definition for structure in `beamercolorthemedefault.sty`
fg=normal text.fg
}
% Frame titles and `\plain` slides
\setbeamercolor{frametitle}{use=palette primary, parent=palette primary}
\setbeamercolor{palette primary}{%
% The “primary” palette should be used for the most important navigational
% elements, and possibly of other elements.
% The metropolis color theme uses it for frame titles and `\plain` slides.
use=normal text,
fg=normal text.bg,
bg=normal text.fg
}
% Progress bar and title separator
\setbeamercolor{title separator}{use=progress bar, parent=progress bar}
\setbeamercolor{progress bar}{%
use=alerted text,
fg=alerted text.fg,
bg=normal text.bg!50!fg
}
% Blocks
\if@beamer@metropolis@blockbg
\setbeamercolor{block title}{%
use=normal text,
fg=normal text.fg,
bg=normal text.bg!80!fg
}
\else
\setbeamercolor{block title}{use=normal text, parent=normal text}
\fi
\setbeamercolor{block title alerted}{%
use={block title, alerted text},
bg=block title.bg,
fg=alerted text.fg
}
\setbeamercolor{block title example}{%
use={block title, example text},
bg=block title.bg,
fg=example text.fg
}
\setbeamercolor{block body alerted}{use=block body, parent=block body}
\setbeamercolor{block body example}{use=block body, parent=block body}
\setbeamercolor{block body}{
use={block title, normal text},
bg=block title.bg!50!normal text.bg
}
% Footnotes
\setbeamercolor{footnote}{fg=normal text.fg!90}
\setbeamercolor{footnote mark}{fg=.}
\mode<all>