Most active commenters
  • meodai(6)

←back to thread

97 points meodai | 15 comments | | HN request time: 1.148s | source | bottom

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/

1. magic_hamster ◴[] No.44335894[source]
This is nicely done, but can you please explain why you need this? What is the use of the color names when you already know the actual color value and can use it?
replies(3): >>44335939 #>>44336037 #>>44336101 #
2. auscompgeek ◴[] No.44335939[source]
This can be useful for accessibility. For example you might have a colour palette that users can add to, but the colours are only stored as hex codes. Giving a screen reader user just RGB values isn't as helpful as providing a name alongside it.
3. meodai ◴[] No.44336037[source]
Thanks! Good question – it's mostly about readability and communication. Hex codes are precise but not intuitive. Names give context, like saying “salmon” instead of #fa8072. That’s helpful in design tools, UI previews, generative art, or even debugging.

Also, the API works the other way around too – you can search by name to get the matching color: https://api.color.pizza/v1/docs/#api-Default-getColorNames. I did not add it to the website yet, because I don't have good UI ideas for it yet.

4. chownie ◴[] No.44336101[source]
N=1 but I'm colourblind and frequently I need to talk to someone about a UI colour while not having any idea what the colour is called, this kind of thing is useful for me.
replies(5): >>44336124 #>>44336292 #>>44336317 #>>44336852 #>>44349716 #
5. meodai ◴[] No.44336124[source]
That's great to hear! I've gotten some very positive feedback from sight-impaired users for this little tool that uses the API: https://words.github.io/color-description/ — it turns colors into descriptive text (no AI involved)
6. polonbike ◴[] No.44336292[source]
N>1, proportion of colourblind people depends on the origin, but there are many of us. In Europe, nearly 10% of males are impacted by one of the colourblind variant, aka millions of people. Some of those people are dev, designers, or working alongside some sort color requirements, but none of them are graphists and can choose colors. Having a tool to provide a name instead of an hex code is useful to discuss colors with other stakeholders (customers, colleagues, etc...)
replies(1): >>44336980 #
7. unconed ◴[] No.44336317[source]
I made a similar tool that can work on images and the camera. In addition to color picking, it adds moving stripes so you can visually tell the difference between colors you might otherwise not tell apart.

https://unblind.tech

8. pimlottc ◴[] No.44336852[source]
I would also find such a tool useful, but names like “Watermelon Sugar”, “Tidal”, or “Singapore Orchid” don’t really help me at all. Just tell me something like “dark brown”, “pale green”, “hot pink”, “tan”, etc.
replies(2): >>44337898 #>>44338099 #
9. rustc ◴[] No.44336980{3}[source]
> Having a tool to provide a name instead of an hex code is useful to discuss colors with other stakeholders (customers, colleagues, etc...)

But how useful are names that this website shows, e.g. the first few random names I got were "Singapore Orchid", "Scented Spring", "Lamiaceae", and "Lunatic Sky Dancer"?

replies(1): >>44338090 #
10. IshKebab ◴[] No.44337898{3}[source]
Yeah I agree. Maybe useful if it wasn't nonsense paint colour names.
replies(1): >>44338193 #
11. meodai ◴[] No.44338090{4}[source]
I provide all kind of name lists. Depends a lot on what you are trying to accomplish. But there are plenty of lists providing more recognizable ones.
12. meodai ◴[] No.44338099{3}[source]
If you scroll down a bit, you will see that the api provides all kind of lists, there are plenty that are more descriptive or simpler depending on what you are going for.
13. meodai ◴[] No.44338193{4}[source]
The API provides plenty of lists that should fit your less ‘nonsensical’ needs.
14. andoando ◴[] No.44349716[source]
Wouldnt it be 10x better to just show them the color?
replies(1): >>44375246 #
15. chownie ◴[] No.44375246{3}[source]
Unfortunately I'm not a chameleon, so I can't magic it up on my skin mid-conversation. We communicate verbally, I need a name or I can't talk about it.