# Change color method used with beamer

We have many issues when using xcolor with right to left text (pdflatex and xelatex)
Colors bizarre results with right to left text

The answer suggest to use the command from fontspec package

{\addfontfeature{Color=red} colored text here }


I thought if it is possible to change the definition of command \color to be the same as Color from fontpec we can solve those issues even partially

\documentclass{beamer}
\usepackage{fontspec}
\setmainfont[Script=Arabic]{Amiri}
\usefonttheme{serif}

% redefine \color{#1} to be the same as \addfontfeature{Color=#1}

\usepackage[rldocument]{bidi}

\begin{document}
\raggedleft

\begin{frame}{title}
\begin{enumerate}\raggedleft
\item
text from right to left \alert{text from right to left text from right to left
text from right to left} out
\end{enumerate}

\end{frame}

\begin{frame}{title}

\begin{enumerate}\raggedleft
\item
text from right to left \alert{text from right to left text from right to left
text from right to left} out
\end{enumerate}

\end{frame}

\end{document}


No, this is really not a good idea. \addfontfeature affects only fonts, not rules, not drawings like tikz. So in presentations you would e.g. loose all the frame colors:

\documentclass{article}
\usepackage{fontspec,tikz}
\setmainfont{TeX Gyre Heros}
\begin{document}
{\color{red}
some text in red
\rule{1cm}{1cm}
\tikz\draw[<->,red](0,0)--++(1,1);
}
\color{red}
some text in red
\rule{1cm}{1cm}
\tikz\draw[<->,red](0,0)--++(1,1);
\end{document}