3 ms·
I'd probably try to convert the RGB to HSV and then sanitize the values a bit. Get rid of too flashy or too unsaturated colors.
by looki 10y ago
I'd probably try to convert the RGB to HSV and then sanitize the values a bit. Get rid of too flashy or too unsaturated colors.
- Zarel 10y agoThis is what Pokémon Showdown does. https://github.com/Zarel/Pokemon-Showdown-Client/blob/434322fecce4deeec9533c4023f0273101055a80/js/battledata.js#L65-L108 https://github.com/Zarel/Pokemon-Showdown-Client/blob/434322... A naive HSL implementation will lead to very light yellows/cyans and very dark blues. PS corrects for this by manually darkening yellows/cyans and lightening blues. A better solution might be to use a color model based on perceived luminance, like one discussed here: https://news.ycombinator.com/item?id=11437794 https://news.ycombinator.com/item?id=11437794