Closed hugovk closed 6 years ago
And uses the Dopplr hashing function to give unique colours for version numbers, so we always get the same colour for a version, even if we don't know what versions exactly we'll get for a given data set.
We wanted a deterministic RGB colour value for each city. At first, we tried mapping the latitude and longitude of a city to a point in colour space, but we found that this made neighbouring cities too similar in colour. This means that people who travel frequently between Glasgow and Edinburgh wouldn’t clearly see the difference in colour between the two. Also, since so much of the Earth’s surface is covered in water rather than cities, it leads to a sparse use of the potential colour space. In the end, we went with a much simpler approach: we take the MD5 digest of the city’s name, convert it to hex and take the first 6 characters as a CSS RGB value.
From the defunct Dopplr blog, saved by Ian Kennedy.
See also https://optional.is/required/2010/12/13/hls-world-map/ and https://optional.is/required/2011/01/12/maximum-color-contrast/.
For example: