Improve debug color code

This PR fixes one bug and makes debug color succinct.