←back to thread

97 points meodai | 4 comments | | HN request time: 0.827s | 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 #
meodai ◴[] No.44336041[source]
nice its very addicting :D
replies(1): >>44337229 #
1. johnisgood ◴[] No.44337229[source]
Guess the Color

Lilac Rose

Your score

81/100

First try!

My final score was 286/500 :(

At any rate, it keeps using the same colors, so this needs to be improved.

replies(1): >>44338741 #
2. brulard ◴[] No.44338741[source]
And the scoring is quite generous. For the coupe color I picked vibrant red, correct was some steel gray and I got 60/100 points
replies(2): >>44339033 #>>44346635 #
3. johnisgood ◴[] No.44339033[source]
I agree.

I remember there were a couple of websites like this, however, with random colors, better scoring, etc.

For example I found these:

https://color.method.ac

https://hexcodle.com (this one has a 10 hour limit per game, ugh)

But there were many others. Ideas? I am looking for something like colorguesser.com.

4. kiru_io ◴[] No.44346635[source]
Actually I experienced with different distance metrics and settled for one.