How do I pass color to the gauge chart based on an array of values in d3.js?

This is the link I have referred to and I want to pass a different color to the arc based on the dynamic array value:

<http://bl.ocks.org/msqr/3202712>