-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamercolorthemesolarized.sty
185 lines (165 loc) · 6.85 KB
/
beamercolorthemesolarized.sty
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
% Beamer Color Theme using the Solarized Palette,
% http://ethanschoonover.com/solarized.
%
% Copyright 2012 Jeffrey B. Arnold
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
\ProvidesPackage{beamercolorthemesolarized}[2013/10/11 1.0.1 Solarized color theme for beamer]
\RequirePackage{etoolbox}
\RequirePackage{kvoptions}
%% This is ugly. First time using options and conditionals in LaTeX
\SetupKeyvalOptions{
family=solarized,
prefix=solarized@,
}
\DeclareBoolOption[false]{dark}
\DeclareComplementaryOption{light}{dark}
\DeclareStringOption[yellow]{accent}[yellow]
\ProcessKeyvalOptions*
% Solarized palette
\definecolor{solarizedBase03}{HTML}{002B36}
\definecolor{solarizedBase02}{HTML}{073642}
\definecolor{solarizedBase01}{HTML}{586e75}
\definecolor{solarizedBase00}{HTML}{657b83}
\definecolor{solarizedBase0}{HTML}{839496}
\definecolor{solarizedBase1}{HTML}{93a1a1}
\definecolor{solarizedBase2}{HTML}{EEE8D5}
\definecolor{solarizedBase3}{HTML}{FDF6E3}
\definecolor{solarizedYellow}{HTML}{B58900}
\definecolor{solarizedOrange}{HTML}{CB4B16}
\definecolor{solarizedRed}{HTML}{DC322F}
\definecolor{solarizedMagenta}{HTML}{D33682}
\definecolor{solarizedViolet}{HTML}{6C71C4}
\definecolor{solarizedBlue}{HTML}{268BD2}
\definecolor{solarizedCyan}{HTML}{2AA198}
\definecolor{solarizedGreen}{HTML}{859900}
% Set Accent color
% Ugly. Should be done with a switch
\ifdefstring{\solarized@accent}{yellow}{
\colorlet{solarizedAccent}{solarizedYellow}
}{}
\ifdefstring{\solarized@accent}{orange}{
\colorlet{solarizedAccent}{solarizedOrange}
}{}
\ifdefstring{\solarized@accent}{red}{
\colorlet{solarizedAccent}{solarizedRed}
}{}
\ifdefstring{\solarized@accent}{magenta}{
\colorlet{solarizedAccent}{solarizedMagenta}
}{}
\ifdefstring{\solarized@accent}{violet}{
\colorlet{solarizedAccent}{solarizedViolet}
}{}
\ifdefstring{\solarized@accent}{blue}{
\colorlet{solarizedAccent}{solarizedBlue}
}{}
\ifdefstring{\solarized@accent}{cyan}{
\colorlet{solarizedAccent}{solarizedCyan}
}{}
\ifdefstring{\solarized@accent}{green}{
\colorlet{solarizedAccent}{solarizedGreen}
}{}
%% Set base colors for dark or light versions
%% Dark
% Switch between light and dark themes using the method in the CSS
% stylesheet http://ethanschoonover.com/solarized
\ifboolexpe{ bool {solarized@dark}}{
\colorlet{solarizedRebase03}{solarizedBase03}
\colorlet{solarizedRebase02}{solarizedBase02}
\colorlet{solarizedRebase01}{solarizedBase01}
\colorlet{solarizedRebase00}{solarizedBase00}
\colorlet{solarizedRebase0}{solarizedBase0}
\colorlet{solarizedRebase1}{solarizedBase1}
\colorlet{solarizedRebase2}{solarizedBase2}
\colorlet{solarizedRebase3}{solarizedBase3}
}{
%% Light
\colorlet{solarizedRebase03}{solarizedBase3}
\colorlet{solarizedRebase02}{solarizedBase2}
\colorlet{solarizedRebase01}{solarizedBase1}
\colorlet{solarizedRebase00}{solarizedBase0}
\colorlet{solarizedRebase0}{solarizedBase00}
\colorlet{solarizedRebase1}{solarizedBase01}
\colorlet{solarizedRebase2}{solarizedBase02}
\colorlet{solarizedRebase3}{solarizedBase03}
}
\mode<presentation>
\setbeamercolor{normal text}{fg=solarizedRebase0, bg=solarizedRebase03}
\setbeamercolor{alerted text}{fg=solarizedAccent}
% based css pre element
\setbeamercolor{example text}{fg=solarizedRebase1, bg=solarizedRebase02}
% Header and footer from CSS
\setbeamercolor{footline}{bg=solarizedRebase02,fg=solarizedRebase01}
\setbeamercolor{headline}{bg=solarizedRebase01,fg=solarizedRebase1}
% Titles
\setbeamercolor*{titlelike}{fg=solarizedAccent}
\setbeamercolor*{frametitle}{fg=solarizedAccent}
\setbeamercolor*{title}{fg=solarizedAccent}
% Structure elements use css style for header
\setbeamercolor*{structure}{bg=solarizedRebase01, fg=solarizedRebase1}
% Do not mess with subtle colors in palette. I don't like it.
\setbeamercolor*{palette primary}{bg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette secondary}{bg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette tertiary}{bg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette quaternary}{bg=solarizedRebase01, fg=solarizedRebase1}
% Make Blocks slightly lighter/darker
\setbeamercolor{block title}{fg=solarizedAccent, bg=solarizedRebase02}
%\setbeamercolor{block title alerted}{}
%\setbeamercolor{block title example}{}
\setbeamercolor{block body}{parent=normal text, bg=solarizedRebase02}
% \setbeamercolor{block body alerted}{}
% \setbeamercolor{block body example}{}
% same as footline
% Set Sidebar and footline to use the css style for footer
\setbeamercolor*{sidebar}{parent=headline}
\setbeamercolor*{palette sidebar primary}{fg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette sidebar secondary}{fg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette sidebar tertiary}{fg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette sidebar quaternary}{fg=solarizedRebase01, fg=solarizedRebase1}
% border-color for headings
\setbeamercolor{separation line}{fg=solarizedRebase0}
\setbeamercolor{fine separation line}{fg=solarizedRebase0}
\setbeamercolor*{section in sidebar shaded}{parent=palette sidebar primary}
% a.hover.navlink in CSS
\setbeamercolor*{section in sidebar}{parent=palette sidebar primary, fg=solarizedRebase02}
\setbeamercolor*{subsection in sidebar}{parent=section in sidebar}
\setbeamercolor*{subsection in sidebar shaded}{parent=section in sidebar shaded}
%Global Background must be put in preamble
\ifboolexpe{ bool {solarized@dark}}{
%% Dark
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{style/background.png}}
}{
%% Light
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{style/background_light.png}}
}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{frametitle}{size=\huge}
\setbeamercolor{footcolor}{fg=solarizedAccent, bg=solarizedRebase02}
\setbeamertemplate{footline}
{
\hbox{%
\begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25ex,dp=1ex,center]{footcolor}%
\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.7\paperwidth,ht=2.25ex,dp=1ex,center]{footcolor}%
\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.25ex,dp=1ex,center]{footcolor}%
\usebeamerfont{title in head/foot}
\insertframenumber{} / \inserttotalframenumber
\end{beamercolorbox}}%
}
\setbeamertemplate{navigation symbols}{}
\mode
<all>