Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Fwiw there's an algorithm out there to determine contrast. I wrote something with it years ago (but in C). Too much going on to worry about it and it's an old answer anyway but figured I'd point out that there is a way to determine contrast.
    – Pryftan
    Commented Mar 13, 2019 at 16:46
  • supplement: to wrap colours back to first after all are used, replace the 2nd if with: if(!instance.stringToColorHash[str]) { instance.nextVeryDifferntColorIdx++; instance.nextVeryDifferntColorIdx %= instance.veryDifferentColors.length; instance.stringToColorHash[str] = instance.veryDifferentColors[instance.nextVeryDifferntColorIdx]; }
    – MoonLite
    Commented Nov 9, 2020 at 17:08