change gradient based on centroid list