Can you reproduce this xcolor
bug?
\documentclass{article}
\usepackage{xcolor}
\begin{document}
$X_{a}^{b}$\par
$X_{\color{red}a}^{b}$
\end{document}
pdfLaTex
, LuaLaTex
, XeLaTex
, all create the same result. Even switching to the color
package does not solve it.
\textcolor
(or simply an extra group) usually helps, details to be found in grfguide.tex and color.dtx in the latex distribution.