[Tex/LaTex] Different colors for beamergotobutton and beamerreturnbutton

beamerbuttoncolorreturn

In This thread, @luigi_tiburzi shows how to change the color of a beamer button, i.e.,

\setbeamercolor{button}{fg=black,bg=red}

Unfortunately it changes both the goto and return buttons

I tried the obvious thing:

\setbeamercolor{beamerreturnbutton}{fg=black,bg=red}
\setbeamercolor{beamergotobutton}{fg=black,bg=blue}

Is there a way to do this?

Best Answer

The different buttons don't have individual colors, so just \setbeamercolor won't work.

But you can redefine one of the button commands and set the colors therein.

\documentclass{beamer}

\setbeamercolor{button}{fg=white,bg=blue}
\renewcommand{\beamerreturnbutton}[1]{%
    \begingroup% keep color changes local
    \setbeamercolor{button}{fg=black,bg=red}%
    \beamerbutton{\insertreturnsymbol#1}% original definition
    \endgroup
    }

\begin{document}
\begin{frame}{Colorful Buttons}
\beamergotobutton{Goto 1}

\beamerreturnbutton{Return}

\beamergotobutton{Goto 2}
\end{frame}
\end{document}

enter image description here