Changed getColor function