I am writing a presentation in beamer. I have a background image that I have included with \setbeamertemplate{background canvas}{...}
. Within a regular slide, I now would like to create a rectangle that fades from a color to fully transparent in Tikz. If I create a rectangle with fading, i.e. \tikz{\fill[left color=RED,right color=transparent] (0,0) rectangle (\linewidth,1.5em);}
It creates the rectangle, but rather than being see-through at the right end, it is black.
Is there a way to define opacity in fade, such that the background image becomes visible?
M.W.E
\documentclass{beamer}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{shapes.arrows, fadings}
\setbeamertemplate{background canvas}{\includegraphics[width=\paperwidth]{picture.jpg}}
\begin{document}
\begin{frame}
\tikz{\fill[left color=red,right color=transparent] (0,0) rectangle (\linewidth,1.5em);}
\end{frame}
\end{document}
(Use any random picture for the background)