This is already being implemented in Google Play and I want to use it in my app. I've implemented the sliding tabs and toolbar using the android design library. My application features 4 tabs and I want to achieve this kind of color change among these tabs. Here are the screenshots of the Google Play app which I was referring to.
First Tab
Second Tab
Third Tab - same root as above links with the extension /Mc3a7.png (Apologies for this, but I'm not able to post more than 2 links due to a low reputation.)
Please note that a solution which is being implemented in JAVA will be preferred by me over one which suggests using XML for this purpose :)