As is probably well known, footnote marks in beamer are colored using the footnote mark
beamer-color, which seems to default to black, so that footnote marks are black even when the surrounding text has a different color. Example:
\documentclass{beamer}
\begin{document}
\begin{frame}
\color{red}some text\footnote{test} and some more text
\color{green}some text\footnote{test} and some more text
\end{frame}
\end{document}
which produces
What would be the cleanest way to change this so that footnote marks take on the color of the surrounding text? In this case I'd like the 1 in the main text to be red and the 2 in the next line to be blue, but without explicitly having to write those colors. The 1 and 2 in the footnotes themselves should likewise take on the color of footnote text, which in this case is black.
In particular, I'm not looking for this:
{\setbeamercolor{footnote mark}{fg=red}
\color{red}some text\footnote{test} and some more text
}
because that would also change the color of the mark in the footnote, and also because I have situations in which it's not so easy to figure out what color the surrounding text actually is.
Undefining the color as suggested in this other question, with
\setbeamercolor{footnote mark}{use=,parent=,fg=,bg=}
doesn't work either.
What's the cleanest way to make this happen?
An ideal solution would make footnote marks take on the surrounding text color by default but still respect \setbeamercolor{footnote mark}{...}
if I set it explicitly. But for my current project, it will be acceptable if setting the footnote mark
beamer-color has no effect.