should this be function(d,i), with getColor(d,i) ?