3

MWE

\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}

What I'd like to be able to do is set top/bottom the same way I set midpoint, since (the title area being white) the junction of the white background with a sudden and noticeable blue is extremely offsetting.

I've looked through the manual, but to my knowledge there is no explicit support for this.

4
  • You may find this useful.
    – jub0bs
    Apr 22, 2013 at 22:20
  • @jubobs so basically you defined your own rectangle in which to shade things --- so it may require a bit of math, but these rectangles could potentially be stacked upon each other to produce the desired effect. Apr 22, 2013 at 22:34
  • 2
    Yes. Don't hesitate to post a solution to your own question here if you achieved the desired effect.
    – jub0bs
    Apr 23, 2013 at 8:26
  • @JosephWright I never did run with this idea, but I'll see if I can draw something up (at least on the small scale). At the very least, someone more PGF-y can come along and automate it if they so desire. Aug 14, 2013 at 12:42

1 Answer 1

1

Well, midpoint wasn't doing what I thought it was doing, anyway :) If I recall correctly, I wanted to keep the title area completely white. This can be done by setting the middle color to white and setting the midpoint to taste:

\setbeamertemplate{background canvas}[vertical shading]
  [bottom=blue!5,top=white,middle=white,midpoint=.75]

However, if you want a more general solution, you can define arbitrary gradient anchors by redefining one of PGF's internal macros:

\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

A few notes on the relevant macros here:

  • \beamer@bgst the top key value
  • \beamer@bgsm the middle key value
  • \beamer@bgsb the bottom key value
  • \beamer@bgsmp the midpoint key value

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .