Changing Report Table Text Colour Based on Value

I am also trying to add background color dynamically to the rows being returned in my report. I tried setting up a script data source like such:

from java.awt import Color	
	
rawResults = data['SparePartsByMasterPart'].getCoreResults()
hasSpareParts = rawResults.getColumnAsList(rawResults.getColumnIndex('HasSpareParts'))
legendColor = [Color(255,204,204) if val is None else Color(240,240,240) for val in hasSpareParts]
newDS = system.dataset.addColumn(rawResults, legendColor, 'LegendColor', Color)
data['SparePartsWithColor'] = newDS

I get back the error

WARN: Error invoking script.Traceback (most recent call last):
File "function:updateData", line 8, in updateData
TypeError: can't put element of type color in dataset."

Am I formatting this incorrectly, or is this related to the bug being discussed in Can't use Color Datatype in Dataset tag anymore, error: 'Invalid DataType for Dataset.' - #7 by matthew.byars? I am on 8.1.23.