matrix cell value different background color

Hi all.
There is a possibility of color cell based on text value in matrix view?

I have this code, which return text in cell.
But I want different color based on different text value.

[code] scheduler.templates[“matrix_cell_value”] = function(ar){ // ar = array of events for that cell or undefined
if(ar) { // there are some events
text = ‘’;
for(var i=0; i<ar.length; i++)
text += “

”+ar[i].text+"

";
return text;
}
   return "";
};[/code]

Thank you.

There is a matrix_cell_class template, result of which will be used as css class of the cell

Thank you for answer.

Please, can you post an example ?
I’m confused.

Thank you very much.

You can check
dhtmlxScheduler\samples\06_timeline\01_slots.html

it colors cells based on events count and day of week.