To add to TheTwo, you need an RGBA brush tip - or make your own RGBA brush tip. And set it to gradient map. you can then select FG to BG, or BG to FG in gradient. Then just pick bg/fg color like the vid then paint away. Works best with RGBA brush with clear contrast in color.
Here’s tuto for the brush tip type:
Looking forward to the kind of brush you be able to create. Good Luck ^-^