[Tex/LaTex] How to disable color gradient between block title and block body in Beamer

beamercolorgradient

I'm using the "Warsaw theme" in my beamer slides, so how could I

  1. Disable color gradient between block title and block body;
  2. Disable the block's shade;
  3. I don't want to use the "Berkeley theme" which has no a block with "Rounded Corner Rectangle".

thanks.

Best Answer

Warsaw internally uses beamerboxesrounded which applies the bmb@transition shading to add color between the title and the body parts of blocks. Here's the original definition (found in the file beamerbaseboxes.sty):

\pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
  color(0pt)=(lower.bg); color(2pt)=(lower.bg); color(4pt)=(upper.bg)}

Change that definition to suppress the transition effect.

To suppress the shading, redefine the blocks template using

\setbeamertemplate{blocks}[rounded][shadow=false] 

The complete code:

\documentclass{beamer}
\usetheme{Warsaw}

\setbeamertemplate{blocks}[rounded][shadow=false]
\makeatletter
\pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
  color(0pt)=(upper.bg); color(2pt)=(upper.bg); color(4pt)=(upper.bg)}
\makeatother

\begin{document}
\begin{frame}{A frame}
\begin{block}{A block}
    Some text
\end{block}
\end{frame}
\end{document}

enter image description here