Event color function refactoring.