I would like to define a command for highlighting in the following style.
Some people do this on paper and I would like to mimic that on a particular document. How could I achieve this? I thought of using the package tcolorbox, but I am at a loss as to how to approach it using the package and as it is simple perhaps it could be done without using this package. I would like the command to receive as arguments the colour of the highlighting and the content to be highlighted. I would like this to work with XeLaTeX.
EDIT: I've tested @abcdefg's solution and the following problem arose.
How can I make the rectangle be always at the same level? It would be nice if it could begin a little bellow the line base and advance up to the middle height of the characters. It would also be nice if the behaviour of the macro were favorable to line breaks.


soulorulempackage. If LuaLaTeX was an option,lua-ulwould be interesting as well. – Skillmon Nov 18 '20 at 19:39