To exceed expectations, to do better than expected.
The California smog test is tough, but my car passed with flying colors. Color(s) has numerous meanings. An early use of the word is flag, pennant, or badge. "Passed with flying colors" comes from sailing ships that, when passing other ships at sea, would fly their colors (flags) if they wanted to be identified.