Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is neat, coincidentally I was wondering about a superficially similar problem recently:

Given a list of arbitrary strings, generate a consistent mapping from that list to a color palette of distinguishable colors.

This is distinct from deterministically mapping a single string to a single color (easy) because the intention is to provide a reasonably distinct set of colors, which I think can't be guaranteed when looking at single values.

Bonus: if [str1, str2, str3] -> [rgb1, rgb2, rgb3], have the map update incrementally, so that [str1, str2, str3, str4] -> [rgb1, rgb2, rgb3, rgb4].

I assume I'm restating a version of some existing algorithm, but I don't know what.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: