praekelt/sapphire — pull request #42 by justinvdm (2014-07-16 19:54:41+00:00)
Title: Colours: attempt 3

For some reason, I never made the connection that d3's category scales work the same way other ordinal scales do (as obvious as it is):

> If the range was specified explicitly (as by range, but not rangeBands, rangeRoundBands or rangePoints), and the given value x is not in the scale’s domain, then x is implicitly added to the domain; subsequent invocations of the scale given the same value x will return the same value y from the range.

This means avoiding widgets of the same type starting off on the same colours is already guaranteed, and we don't need to any hashing or anything.