Darker city colours
As we’ve mentioned before, the Dopplr website assigns a distinct colour to every city in our database. This is all very well, but sometimes it generates a colour that’s a little hard to see against a white background (Stockholm’s colour, for instance, is extremely pale), and I wanted to fix this.
Luckily, the W3C have a draft technique for measuring the contrast between two colours, so now when we generate the city colour we first check it to make sure that it’ll be sufficiently visible against our white background. If it’s not, we darken the colour until the contrast is high enough. This means that we’ll be changing the colours of some cities, but the new city colours will be the same as the old colours, only darker.

That’s cool. How do you go about darkening the the colour until it’s contrast-y enough? Start again with a hash of a slightly different string, or alter the rgb values of the hex string to make them darker?
Martin.