# Disable math text inlined color in all display math environments (beamer)

I color my inline math in beamer to improve readability. However, when I use array environment, it will include some inline math being put inside array which is display math. I would like inline math to be colored only when it is put outside any display math environment. Also, the tags of the equations seem to change to the same color of the inline math. I would rather like it black

\documentclass[aspectratio=169, xcolor={x11names}]{beamer}

\usecolortheme{seahorse}
\usefonttheme[onlylarge]{structurebold}
\setbeamercolor{math text inlined}{fg=SpringGreen3}

\begin{document}

$$\bar{I}_{R}(n) = \left\lbrace \begin{array}{ccl} I_{R, \thinspace i} &\text{if} &n = i \\ I_{R, \thinspace j} &\text{if} &n = j \\ 0 & \text{if} &n \neq i \text{~or~} j \end{array} \right.$$

\end{document}


One possibility could be to change the colour back to black by using custom defined column types:

\documentclass[aspectratio=169, xcolor={x11names}]{beamer}

\usecolortheme{seahorse}
\usefonttheme[onlylarge]{structurebold}
\setbeamercolor{math text inlined}{fg=SpringGreen3}

\usepackage{array}
\newcolumntype{C}{>{\color{black}}c}
\newcolumntype{L}{>{\color{black}}l}

\makeatletter
\def\tagform@#1{\maketag@@@{\color{black}(\ignorespaces#1\unskip\@@italiccorr)}}
\makeatother

\begin{document}

\begin{frame}
$$\bar{I}_{R}(n) = \left\lbrace \begin{array}{CCL} I_{R, \thinspace i} &\text{if} &n = i \\ I_{R, \thinspace j} &\text{if} &n = j \\ 0 & \text{if} &n \neq i \text{~or~} j \end{array} \right.$$
\end{frame}

\end{document}