←back to thread

97 points meodai | 1 comments | | HN request time: 0.211s | source

I built this API to return the closest named color for any hex value—using curated lists like my own [1], XKCD [2], and others.

I made it from scratch without Express or any frameworks because:

- I’m a frontend/interaction dev and wanted to learn how to build an API from the ground up. - Existing APIs didn’t guarantee unique names per color—mine does. - It also supports WebSocket updates, gzip responses, and multiple name sets.

I’ve been collecting color names for over 10 years [1]. With ~30,000 entries, bundling them into every color-related project became excessive. This API keeps things lightweight—for me and hopefully for others too.

GitHub: https://github.com/meodai/color-name-api

Would love feedback on naming logic, accuracy, performance, or backend best practices I might’ve missed.

[1] Large Color Name List: https://github.com/meodai/color-names [2] XKCD color survey results: https://xkcd.com/color/rgb/

Show context
kiru_io ◴[] No.44335842[source]
Wow, pretty cool to see the color-names project here. I made a simple color guessing website a few years ago [0] using your library. I almost forgot it till someone reminds how they enjoyed it ([1]).

[0] https://colorguesser.com/ [1] https://x.com/wifeofnoob/status/1935788167086436375

replies(2): >>44336041 #>>44339831 #
remram ◴[] No.44339831[source]
Fun! If I may make one suggestion, could you please show the color I picked next to the real one once it is revealed?

edit: I get the same 5 colors every time?

replies(1): >>44346621 #
1. kiru_io ◴[] No.44346621[source]
> I get the same 5 colors every time? That's probably a bug.

> Fun! If I may make one suggestion, could you please show the color I picked next to the real one once it is revealed? The color of the color-name changes to what you picked.