For something like \hat{w} or \vec{v} is it possible to set the background color for just the accent, i.e., the background of w and v would be normal, but the circumflex and vector symbol would be highlighted?
I'm trying this on KaTeX, where most of the styling is handled by HTML commands; however, I'm interested in any tex-based solutions.

\htmlStyle{background-color:...}which didn't work. I'll have to have a closer look at the solutions to see if any could be generalized to a bg colour. Thanks for taking the time to link a similar question! – Rax Adaam Nov 08 '21 at 17:02