2d editing program does what you want to do, photoshop, gimp, etc.

To select a color:
Magi wand tool. (Photoshop)
To fill that color with a texture:
Paint bucket tool. (Photoshop)

I think that was what you asked.