A's color themed with some comments to explain a little bit of what's going on.
Warning this links to an older version of topojson that does things a little different and makes it hard to color by scale depending on neighbors in my next example.
Modified http://d3js.org/d3.v3.min.js to a secure url
Modified http://d3js.org/topojson.v0.min.js to a secure url
https://d3js.org/d3.v3.min.js
https://d3js.org/topojson.v0.min.js