xsavebox has the ability to color saved boxes according to the ambient text. tikzpictures have the same ability. However, the combination of these does not seem to have this ability.
\documentclass{article}
\usepackage{tikz}
\usepackage{xsavebox}
\begin{xlrbox*}{SavedPar}%
boxed paragraph
\end{xlrbox*}
\newcommand\TestTikZ{\begin{tikzpicture}
\draw circle[radius=1cm];
\end{tikzpicture}}
\begin{xlrbox*}{SavedTikZ}%
\TestTikZ
\end{xlrbox*}
\begin{document}
test, \theSavedPar, \TestTikZ, \theSavedTikZ
\vskip1cm
\textcolor{red}{test, \theSavedPar, \TestTikZ, \theSavedTikZ}
\end{document}
As you can see, the circle on the bottom left is not colored even though the tikzpicture from the macro and the saved text box are.
The question is whether one can make the saved tikzpicture also become color sensitive.
P.S. I experimented with this thread, but could not make this work either.

\tracingmacros=1to find out what is going on? Well, this question is to find out if somebody already has figured out what is going on, and can detail a way that works. One possible application is to create monochromatic symbols with TikZ, which acquire the color of the surrounding text. This works if you put the plaintikzpicturebut not when you save thetikzpicturein a box. – Apr 03 '21 at 14:33\def\pgfsetcolor#1{}before the tikzpicture when saving it. But I'm not giving a garanty that it doesn't explode somewhere if you use more complicated examples. – Ulrike Fischer Apr 03 '21 at 15:34