# Gradient to transparent (horizontal) for beamer frametitle

I would like my frametitle bg to fade horizontally to a background image.

I have attempted to modify the solution for vertical gradients found here: Beamer theme with fading (=gradient to transparent) to background image by replacing "fade bottom" with "fade right", etc. However I cannot get the frametitle to appear within the horizontally faded area (or to overlay any other text in this area)---the solution given here creates a faded overlay beneath the frame title (whereas I want the faded overlay to be behind the title). Essentialy, what I want is a fade-to-transparent version of what is found here: How can I have a horizontally shaded frametitle in beamer?

I am using the Madrid theme.

I would much appreciate any help you can offer.

Thanks!

Edit: (apologetically inelegant) code follows:

\documentclass[aspectratio=169]{beamer}

%For the semi-transparent text boxes
\usepackage[framemethod=tikz]{mdframed}
\newmdenv[tikzsetting={draw=black,fill=tan,fill opacity=0.92, line width=0pt},
backgroundcolor=none,leftmargin=10,rightmargin=10,innertopmargin=4pt]
{titleBox}

\usepackage{ragged2e}
\usepackage{etoolbox,color,amsfonts}
\justifying
\title{My title}
\author[me]{Me}
\institute{My institute}
\date{Date}

%For the semi-transparent footline
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\end{beamercolorbox}%
\end{beamercolorbox}%
\end{beamercolorbox}}%
\vskip0pt%
}

%Various color/structure definitions (some of the custom colors are used elsewhere)
\definecolor{tan}{RGB}{244,229,192}
\definecolor{mypurple}{RGB}{88,68,70}
\definecolor{mytan}{RGB}{255,199,0}
\definecolor{wyte}{RGB}{210,210,210}
\setbeamercolor*{palette primary}{use=structure,fg=tan,bg=mypurple}
\setbeamercolor*{palette secondary}{use=structure,fg=mypurple,bg=tan}
\setbeamercolor*{palette tertiary}{use=structure,fg=tan,bg=mypurple}
\setbeamercolor{item projected}{fg=white,bg=mypurple}
\setbeamertemplate{enumerate items}[default]
\setbeamercolor{block title}{fg=mypurple}
\setbeamercolor{local structure}{fg=mypurple}
\setbeamertemplate{itemize item}[triangle]
\setbeamercolor{block title}{fg=white,bg=mypurple}
\setbeamercolor{block body}{fg=black,bg=wyte}
\setbeamercolor{title}{fg=black, bg=mytan}
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true]
\setbeamercolor*{frametitle}{fg=tan}

\usepackage{graphicx}

%For background image
\usebackgroundtemplate%
{%
\includegraphics[width=\paperwidth,height=\paperheight]{intro.jpg}%
}

\begin{document}

\begin{frame
\begin{titleBox}
\begin{center}
My Title
\end{center}
\end{titleBox}
\end{frame}

\begin{frame}{Introduction}%The title bg here is what I want to fade; but not the fg
\begin{titleBox}
Goal of the talk...
\end{titleBox}

\end{frame}
\end{document}

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – cfr Feb 22 '15 at 21:59

Here is a solution. It's rather inelegant as it involves vertical re-positioning of separate boxes---one for the fade, and a separate for the frametitle. The right hand side of the fade is somewhat sharper than I'd like, but here goes the relevant code addition:

\usepackage{tikz}
right color=transparent!100] (0,0) rectangle (2,2);

\hbox{%For the fade box---this has to come first otherwise the title won't appear on top'' of the faded box