Convert every possible RGB value to HSL to map the overlapping color space.
- Save this locally
- Install the color-convert package
- Run with node (
node map-hsl.js
)
duplicate colors: 14348830
% loss: 85.52569150924683
🤷♂️ Based on the RGB <> HSL formula used, you will get different numbers in the end. When I wrote my own algorithm I got different results than using the color-convert
library. It call comes down to differences in rounding, and even questions on whether or not 0° and 360° hue are the same thing. When you try and implement HSL, you realize there’s a lot more ambiguity than anticipated.
But no matter what formula you end up using, you should end up somewhere within this ballpark.