Closed gibtang closed 9 months ago
hey @gibtang thanks for reporting that. This repository only contains the names, this is example code to help people implement it. I don't need it to be robust, just get the point across. But I guess adding a simple .toLowerCase()
in the example does not hurt too much.
Example, this works
let someColor = namedColors.find(color => color.hex === '#ffffff'); console.log(someColor.name); // => white
But
let someColor = namedColors.find(color => color.hex === '#FFFFFF'); console.log(someColor.name); //does not work
Following Postel's Law, it would be good to accept uppercase hexcodes too. I can file a PR for this if needed