summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx
blob: 15e5a94897b9a94e13966a06431b3003837e6638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
% \iffalse meta-comment -------------------------------------------------------
% Copyright (C) 2021 Thomas Lambert <trigon@thl.ovh>
% Other contributors to this theme are listed here:
%     https://gitlab.com/thlamb/beamertheme-trigon/-/graphs/master
%
% The original template was heavily inspired by Metropolis from Matthias
% Vogelgesang.
%
% License CC-BY-SA 4.0
% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
% International License (https://creativecommons.org/licenses/by-sa/4.0/)
% ------------------------------------------------------------------------- \fi
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamercolorthemetrigon}[2021/09/06 v0.6.0 Trigon color theme]
%</package>
% \fi
% \CheckSum{0}
% \StopEventually{}
% \iffalse
%<*package>
% ------------------------------------------------------------------------- \fi
%
% \subsection{\themename color theme}
%
% A |beamer| color theme sets the colors used for the different elements of the
% document.
%
% \subsubsection{Package dependencies}
%    \begin{macrocode}
\RequirePackage{pgfopts}
%    \end{macrocode}
%
%
%
% \subsubsection{Options}
% \begin{macro}{colors}
%    Provides the option to have a dark background and light foreground instead
%    of the reverse.
%    \begin{macrocode}
\pgfkeys{
  /trigon/color/background/.cd,
    .is choice,
    dark/.code=\trigon@colors@dark,
    light/.code=\trigon@colors@light
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{headingcolor}
%    Select the color to use for all headings (title, section, frame, etc.).
%    \begin{macrocode}
\def\headcol{tDefaulttxt}
\pgfkeys{
  /trigon/color/headingcolor/.cd,
    .is choice,
    default/.code=\def\headcol{tTxt},
    theme/.code=\def\headcol{tPrim}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{textcolor}
%    Select the color to use for all headings (title, section, frame, etc.).
%    \begin{macrocode}
\def\txtcol{black}
\pgfkeys{
  /trigon/color/textcolor/.cd,
    .is choice,
    default/.code=\def\txtcol{tTxt},
    theme/.code=\def\txtcol{tPrim!50!tTxt}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{block}
%    Optionally removes the light grey background to block environments like
%    |theorem| and |example|.
%    \begin{macrocode}
\pgfkeys{
  /trigon/color/block/.cd,
    .is choice,
    transparent/.code=\trigon@block@transparent,
    fill/.code=\trigon@block@fill
}
%
% \begin{macro}{\trigon@color@setdefaults}
%    Sets default values for color theme options.
%    \begin{macrocode}
\newcommand{\trigon@color@setdefaults}{
  \pgfkeys{/trigon/color/.cd,
   background=light,
   block=fill,
   headingcolor=default,
   textcolor=default
  }
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Base colors}
%
%    \begin{macrocode}
\definecolor{tGreenBlue}{HTML}{00707F}
\definecolor{tGreenBlueLight}{HTML}{5FA4B0}
\definecolor{tOrange}{HTML}{F07F3C}
\definecolor{tYellowOrange}{HTML}{F8AA00}
\definecolor{tBeigePale}{HTML}{E6E6E1}
\definecolor{tBeige}{HTML}{C6C0B4}
\definecolor{tDarkBg}{HTML}{232931}
\definecolor{tDarkFg}{HTML}{EEEEEE}
\definecolor{tLightBg}{HTML}{FFFFFF}
%    \end{macrocode}
%
% \subsubsection{Derived elements}
%
% All the elements are set using the base colors defined here above.
%    \begin{macrocode}
\newcommand{\trigon@colors@dark}{
  \colorlet{tPrim}{tGreenBlueLight}
  \colorlet{tSec}{tGreenBlue}
  \colorlet{tAccent}{tYellowOrange}
  \colorlet{tTxt}{tDarkFg}
  \colorlet{tBg}{tDarkBg}
  \colorlet{tGreyBg}{tGrey!7!tBg}
}
\newcommand{\trigon@colors@light}{
  \colorlet{tPrim}{tGreenBlue}
  \colorlet{tSec}{tGreenBlue}
  \colorlet{tAccent}{tOrange}
  \colorlet{tTxt}{black}
  \colorlet{tBg}{tLightBg}
  \colorlet{tGreyBg}{tGrey!25!tBg}
}
\colorlet{tGrey}{tBeige}
\colorlet{tTheme}{tGreenBlue}
\setbeamercolor{background canvas}{bg=tBg}
\setbeamercolor{normal text}{fg=\txtcol, bg=tBg}
\setbeamercolor{example text}{fg=tPrim}
\setbeamercolor{alerted text}{fg=tAccent}

\setbeamercolor{title}{fg=\headcol, bg= , parent=normal text}
\setbeamercolor{titlelike}{use=title, parent=title}
\setbeamercolor{author}{use=normal text, bg= , parent=normal text}
\setbeamercolor{date}{use=normal text, bg= , parent=normal text}
\setbeamercolor{institute}{use=normal text, parent=normal text}
\setbeamercolor{structure}{use=normal text, fg=normal text.fg}

\setbeamercolor{palette primary}{use=titlelike, parent=titlelike}
\setbeamercolor{frametitle}{use=titlelike, parent=titlelike}
%    \end{macrocode}
%
%
% Block environments such as |theorem| and |example| have a grey-tinted background
% color by default. The option |block=transparent| removes the background color.
%    \begin{macrocode}
\newcommand{\trigon@block@transparent}{
  \setbeamercolor{block title}{%
    use=normal text,
    fg=normal text.fg,
    bg=normal text.bg!96!fg
  }
  \setbeamercolor{block body}{
    use={block title, normal text},
    bg=block title.bg!35!normal text.bg
  }
}
\newcommand{\trigon@block@fill}{
  \setbeamercolor{block title}{%
    use=normal text,
    fg=normal text.fg,
    bg=normal text.bg!80!normal text.fg
  }
  \setbeamercolor{block body}{
    use={block title, normal text},
    bg=block title.bg!50!normal text.bg
  }
}

\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}
%    \end{macrocode}
%
% The color of other smaller elements is defined as follows
%    \begin{macrocode}
\setbeamercolor{footnote}{fg=normal text.fg!90!normal text.bg}
\setbeamercolor{footnote mark}{fg=.}
\setbeamercolor{footline}{fg=normal text.fg!50!normal text.bg, parent=normal text}
\setbeamercolor{caption}{fg=normal text.fg!60!normal text.bg, parent=normal text}

\setbeamercolor{itemize item}{use=example text, parent=example text}
\setbeamercolor{itemize subitem}{use=itemize item, parent=itemize item}
\setbeamercolor{itemize subsubitem}{use=itemize item, parent=itemize item}
\setbeamercolor{enumerate item}{use=example text, parent=example text}
\setbeamercolor{enumerate subitem}{use=enumerate item, parent=enumerate item}
\setbeamercolor{enumerate subsubitem}{use=enumerate item, parent=enumerate item}
\setbeamercolor{description item}{use=example text, parent=example text}
%    \end{macrocode}
%
% \subsubsection{Process package options}
%
%    \begin{macrocode}
\trigon@color@setdefaults
\ProcessPgfPackageOptions{/trigon/color}
%    \end{macrocode}
%
% \iffalse
%</package>
% \fi
% \Finale
\endinput