我想让导航栏的背景颜色为单一颜色,而不是默认的颜色渐变。有什么办法吗?
答案1
Singapore
使用定义为的垂直阴影
\pgfdeclareverticalshading{beamer@headfade}{\paperwidth}
{%
color(0cm)=(bg);
color(1.25cm)=(section in head/foot.bg)%
}
为了获得纯色,您可以重新定义阴影以仅使用一种颜色,如下例所示(当然,structure.fg!25!bg
您可以使用任何您想要的颜色):
\documentclass{beamer}
\usetheme{Singapore}
\makeatletter
\AtBeginDocument{%
{
\usebeamercolor{section in head/foot}
}
\pgfdeclareverticalshading{beamer@headfade}{\paperwidth}
{%
color(0cm)=(structure.fg!25!bg);
color(1.25cm)=(structure.fg!25!bg)%
}
\setbeamercolor{section in head/foot}{bg=}
}
\addtoheadtemplate{\pgfuseshading{beamer@headfade}\vskip-1.25cm}{}
\makeatother
\begin{document}
\begin{frame}
\tableofcontents
\end{frame}
\section{Test section one}
\begin{frame}test\end{frame}
\section{Test section two}
\begin{frame}test\end{frame}
\section{Test section three}
\begin{frame}test\end{frame}
\end{document}
结果: