# How to get the current background color in xcolor?

I read the xcolor documentation and I understood that . is a placeholder for the current text color. How can I get the current background color?

ps: The final purpose of this is to temporarily hide a text; for example if .. is a placeholder for the current background color, I could use \colorlet{tmp}{.}\color{..}#1\color{tmp}.

• There isn't a 'current background' in TeX terms: are you perhaps using beamer? Aug 24, 2020 at 12:59
• No I am not using beamer. I just need to sometimes hide parts of a document. I can't use \phantom because it is incompatible with lists (itemize & enumerate). Aug 24, 2020 at 13:07
• by default there is no background color at all. You can add one with \pagecolor{somecolor} (and then you would know the color). Beside this: setting the color of text doesn't really hide it, it can still be copy&pasted from the file. Aug 24, 2020 at 13:23
• Plus there could be colour boxes or stuff overlaying stuff: really, 'this won't work' Aug 24, 2020 at 13:26
• @ JosephWright "setting the color of text doesn't really hide it, it can still be copy&pasted from the file." I know that but I don't have better idea. As I said, phantom simply don't work at all with itemize: a code as simple as \phantom{\begin{itemize}\item test\end{itemize}} make an error (I am beginning to think that LaTeX is mainly a tricks & hacks language ;) ).If you have another idea for a better hiding, feel free to share it, I will be happy to use it. Thanks Aug 24, 2020 at 16:38