https://imgz.org/i8CEMAJq.png
Create a transparent layer. Paint on it in a colour of your choice. Set layer mode to "darken only" or "lighten only" depending on your background. "Difference" is fun too.
I've been using GIMP for longer than I care to remember and I am painfully aware of what is not great in its UI, which is something that seems to have gotten _worse_ over time. This isn't one of them; to paraphrase, that's just knowing how to use basic features that GIMP and other programs have had since the 1990s.