It might be a good idea to use https://github.com/d3/d3-scale-chromatic instead of the ColorBrewer and ColorUtils scripts.