Here is an example script and the appearance.
def configureCell(self, value, textValue, selected, rowIndex, colIndex, colName, rowView, colView):
if rowIndex <= 2: return {'background': 'red'} else: return {'background': 'blue'}