You made my day, Ellen! I was trying to work out a way to do it months ago for a page I posted to the gallery. Was a little disappointed that I had to make do.
I just tried your technique and it worked [clap hands]. And it got me thinking because I know I would be too impatient sometimes or short of time to 'paint between the lines'. I'd probably choose another mask or just forget it.
And then it came to me - select those 'bits' and then 'fill' !!!!! Voila. Thing with the 'fill' option is that you can keep the transparency.
Means that if you have for instance a landscape with a blue sky and brown earth, you want the bit sticking up from the sky to be blue and the bit sticking out from the brown to be brown. Or whatever colour you like of course but you can be selective about colouring the mask.
So your tip has really been helpful and just had to thank you!! You're a gem.