平均能量损失
\documentclass{beamer}
% Yes, this is a poster, if that matters in the slightest
%\usepackage[orientation=portrait,size=a0]{beamerposter}
\mode<presentation>{}
\setbeamertemplate{background canvas}
[vertical shading]
[bottom=blue!15,top=blue!0,midpoint=.1]
\begin{document}
\begin{frame}[t]{Title!}
Content!
\end{frame}
\end{document}
我希望能够以与设置相同的方式设置top
/ ,因为(标题区域为白色)白色背景与突然出现的明显蓝色的交界处极其偏移。bottom
midpoint
我已查看过手册,但据我所知,没有明确的支持这一点。
答案1
好吧,midpoint
无论如何,它并没有按照我的想法运行 :) 如果我没记错的话,我想让标题区域保持完全白色。这可以通过将颜色设置middle
为white
并将设置midpoint
为口味来实现:
\setbeamertemplate{background canvas}[vertical shading]
[bottom=blue!5,top=white,middle=white,midpoint=.75]
但是,如果您想要一个更通用的解决方案,您可以通过重新定义 PGF 的内部宏之一来定义任意梯度锚点:
\makeatletter
\def\beamer@calcvertshading#1#2#3{%
{\usebeamercolor{palette primary}}
\usebeamercolor{normal text}
\setkeys{beamer@backgroundshade}{top=palette primary.bg!25!bg,bottom=bg,middle={},midpoint=0.5}%
\setkeys{beamer@backgroundshade}{#3}
\ifx\beamer@bgsm\@empty
\pgfdeclareverticalshading{#1}{#2}%
{
% ALTER THESE VALUES
color(0cm)=(\beamer@bgsb);
color(\the\paperheight)=(\beamer@bgst)
}
\colorlet{beamer@backgroundshadestart}{\beamer@bgsb}%
\colorlet{beamer@backgroundshadeend}{\beamer@bgst}%
\colorlet{beamer@average}{beamer@backgroundshadestart!50!beamer@backgroundshadeend}%
\else
\pgfdeclareverticalshading{#1}{#2}%
{
% OR PERHAPS THESE VALUES IF YOU'RE USING `MIDDLE`
color(0cm)=(\beamer@bgsb);
color(\beamer@bgsmp\paperheight)=(\beamer@bgsm);
color(\the\paperheight)=(\beamer@bgst)
}
\colorlet{beamer@average}{\beamer@bgsm}
\fi%
}
\makeatother
这里有一些关于相关宏的注释:
\beamer@bgst
关键top
值\beamer@bgsm
关键middle
值\beamer@bgsb
关键bottom
值\beamer@bgsmp
关键midpoint
值