It is narrated from Sayyidah Asma' (may Allah be pleased with her): We were in her care along with her brother's daughters. One of us would become pure, then pray, then relapse with a little yellow discharge. She would ask her about it, and she would say: Keep away from the prayer as long as you see this (yellowness), until you see pure white.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحيض / 1593