Choose a background, a text colour and one action colour. Name them by their job, not their appearance.
Contrast belongs to a pair of colours. Test text against its actual background. A pair check is not a full interface audit.
Do not communicate a state through colour alone. Add a word, icon or pattern.