Color of event gets overlapped when event clicked for detail

I am able to color my events in the calendar according to the color of the checked nodes. But when i am clicking on the events for detail view the color of the event gets changed to the color of other checked nodes as shown in the attached screenshots. After clicking the detail button the event again get its previous color.But my requirement is that when the event is clicked the color must remain same.
Can you please help me in pointing out the place i am assuming that it can be done in scheduler (in scheduler.render_event) from where the events are again being populated after the event is clicked for detail. Otherwise you can suggest any other options also.

Its quite strange, because event doesn’t have any special styling for selected state, it must use the same template function for css class as default one.

Double-check that css template always return a necessary value.