![如何在序言之后改变投影仪的块阴影淡出的颜色?](https://linux22.com/image/372552/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%BA%8F%E8%A8%80%E4%B9%8B%E5%90%8E%E6%94%B9%E5%8F%98%E6%8A%95%E5%BD%B1%E4%BB%AA%E7%9A%84%E5%9D%97%E9%98%B4%E5%BD%B1%E6%B7%A1%E5%87%BA%E7%9A%84%E9%A2%9C%E8%89%B2%EF%BC%9F.png)
谢谢这个答案,可以使beamer
的块的阴影淡化为背景颜色而不是白色。
正如以下 MWE 所指出的,问题是,提供的解决方案在之后不起作用\begin{document}
,如果有人想改变文档中间的背景颜色,这会很烦人。
beamer
因此问题是:如何在序言之后改变a 的块阴影淡出的颜色?
\documentclass{beamer}
\usetheme{Madrid}
\newcommand{\test}[1][yellow]{%
\setbeamercolor{background canvas}{bg=#1}
\makeatletter
\pgfdeclareverticalshading[black,bg]{bmb@shadow}{200cm}{%
color(0bp)=(#1); color(4bp)=(black!50!bg); color(8bp)=(black!50!bg)}
\pgfdeclareradialshading[black,bg]{bmb@shadowball}{\pgfpointorigin}{%
color(0bp)=(black!50!bg); color(4bp)=(#1)}
\pgfdeclareradialshading[black,bg]{bmb@shadowballlarge}{\pgfpointorigin}{%
color(0bp)=(black!50!bg); color(4bp)=(black!50!bg); color(8bp)=(#1)}
%
\makeatother
}
\test
\begin{document}
\begin{frame}
\begin{block}{Foo}
Bar
\end{block}
\end{frame}
%
\test[cyan]
%
\begin{frame}
\begin{block}{Foo}
Bar
\end{block}
\end{frame}
\end{document}
答案1
使用来自的代码https://github.com/josephwright/beamer/pull/469阴影颜色自动调整:
\documentclass{beamer}
\usetheme{Madrid}
\setbeamercolor{background canvas}{bg=yellow}
\begin{document}
\begin{frame}
\begin{block}{Foo}
Bar
\end{block}
\end{frame}
\setbeamercolor{background canvas}{bg=cyan}
\begin{frame}
\begin{block}{Foo}
Bar
\end{block}
\end{frame}
\end{document}