First of all, I think a problem of your code is that you place the $\times$
inside a \savebox
which essentially prevents the contents from being affected by \color
settings outside of this box. I would therefore suggest that you don't use such a box in this case.
I don't fully understand why the coloring becomes broken. Somehow, the siunitx
package seems not to be able to process a \color
command if this is not the only thing which is placed before the number in the cell that should be formatted. If you place something like \color{white}\times
in front of a number in an S
type cell, only the stuff before the number will be affected by the \color
setting, but not the formatted number.
Compare the following MWE:
\documentclass[margin=10pt]{standalone}
\usepackage{xcolor, siunitx}
\begin{document}
\begin{tabular}{
S[table-format={{\times}2.2}]
}
\color{red} 99.99 \\
\color{red}\times 99.99 \\
\end{tabular}%
\end{document}

However, it is possible to use the option color
to set the color for the formatted number. You only need to set the correct value in one of the cells before the S
type cell. For example like this:
\documentclass[margin=10pt]{standalone}
\usepackage{colortbl, siunitx, booktabs, xcolor}
\def\Scolcolor{black}
\begin{document}
\begin{tabular}{
l c c
>{\color{\Scolcolor}\times\,}S[
table-format={{\times\,}11.2},
table-align-text-before=false,
color=\Scolcolor
]
}
\toprule
Farbe & 1. Ring & 2. Ring & \multicolumn{1}{c}{{3. Ring}}\tabularnewline
\midrule
\rowcolor{black!60}\gdef\Scolcolor{white}%
\color{white}schwarz & \color{white}0 & \color{white}0 & 1\tabularnewline
\rowcolor{brown!50}\gdef\Scolcolor{black}%
braun & 1 & 1 & 10\tabularnewline
\rowcolor{red!50}rot & 2 & 2 & 100\tabularnewline
\rowcolor{orange!50}orange & 3 & 3 & 1000\tabularnewline
\rowcolor{yellow!50}gelb & 4 & 4 & 10000\tabularnewline
\rowcolor{green!30}grün & 5 & 5 & 100000\tabularnewline
\rowcolor{blue!40}blau & 6 & 6 & 1000000\tabularnewline
\rowcolor{violet!30}violett & 7 & 7 & 10000000\tabularnewline
\rowcolor{gray!30}grau & 8 & 8 & 100000000\tabularnewline
\rowcolor{white}weiß & 9 & 9 & 1000000000\tabularnewline
\rowcolor{yellow!10}gold & - & - & 0.1\tabularnewline
\rowcolor{gray!10}silber & - & - & 0.01\tabularnewline
\bottomrule
\end{tabular}%
\end{document}

If you are not bound to use a regular tabular
, you could also try the nicematrix
package (but, here as well, you need to un-box the \times
in order to make things work):
\documentclass[margin=10pt]{standalone}
\usepackage{nicematrix, booktabs, siunitx}
\begin{document}
\NewDocumentCommand{\timesprefix}{}{%
\ensuremath\times\,%
}
\begin{NiceTabular}{
l c c
>{\timesprefix}S[table-format={{\timesprefix}11.2}, table-align-text-before=false]
}
\CodeBefore
\rowcolor{black!60}{2}
\rowcolor{brown!50}{3}
\rowcolor{red!50}{4}
\rowcolor{orange!50}{5}
\rowcolor{yellow!50}{6}
\rowcolor{green!30}{7}
\rowcolor{blue!40}{8}
\rowcolor{violet!30}{9}
\rowcolor{gray!30}{10}
\rowcolor{white}{11}
\rowcolor{yellow!10}{12}
\rowcolor{gray!10}{13}
\Body
\toprule
Farbe & 1. Ring & 2. Ring & \multicolumn{1}{c}{{3. Ring}}\tabularnewline
\midrule
\RowStyle[color=white]{}
schwarz & 0 & 0 & 1 \\
braun & 1 & 1 & 10 \\
rot & 2 & 2 & 100 \\
orange & 3 & 3 & 1000 \\
gelb & 4 & 4 & 10000 \\
grün & 5 & 5 & 100000 \\
blau & 6 & 6 & 1000000 \\
violett & 7 & 7 & 10000000 \\
grau & 8 & 8 & 100000000 \\
weiß & 9 & 9 & 1000000000 \\
gold & - & - & 0.1 \\
silber & - & - & 0.01 \\
\bottomrule
\end{NiceTabular}%
\end{document}

Some other packages that provide macros to set the text color for the whole row could also be of use.