If the cells are using conditional formatting then you should be able to write formulas based on the CF rule(s) being applied.

Tell us what those CF rules are and we can help you write the formulas.