I found the following answer on a related question I hope this helps
Follow these steps:
1. Get your coloring logic in a JS file.
An example:
SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function() {
SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
OnPostRender: function(ctx) {
var colors = {
'Pending' : '#40f600',
'Running' : '#f9af00',
'Completed' : '#f93030'
};
var rows = ctx.ListData.Row;
for (var i=0;i<rows.length;i++)
{
var status = rows[i]["Status"];
var rowId = GenerateIIDForListItem(ctx, rows[i]);
var row = document.getElementById(rowId);
row.style.backgroundColor = colors[status];
}
}
});
});
This script sets the color based on a value of the Status column.
- Upload your JS file to a library within a site.
- Go to your list view in SharePoint, start editing the page.
- Select the list view web part and go to it's properties.
- Expand
Miscellaneous
and specify the location of a JLink file.