Here I have used Flood Fill algorithim to fill the color in the image. How it will work -> when you are going to touch the image it will get the source color of the pixel of that area and then it will start changing the source color pixels to target color pixels untill it doesn't find another color pixels.
<NOTE> It you find any discrepency at the boundaries then Please upgrade the quality of the image you are using. The reason behind that is that at the boundaries if the pixel colors code doesn't match with the source color code then it will stop further change.