setting color for the event

I have color of each of the events in the calendar.

How can I set it the way you have done in the past event example?

You can use Scheduler templates. Please find more information here … om_styling

You can find example at your dhtmlxScheduler package dhtmlxScheduler/samples/02_customization/01_events_coloring.html