
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 17, 2020 12:32 PM
does anyone know a way to convert hexadecimal values to actual color names (or the nearest neighbour).
Examples:
#ffffff = white
#eeeeee = light grey
#45c1f6 = light blue

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 17, 2020 05:21 PM
I would check out the color palette app!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 18, 2020 05:55 AM
I have. It does not convert hex codes automatically, by formula, into color names. What I need is to take hundreds of items and automatically detect the primary color of each item (I have done already that with miniExtensions) and render the resulting hex value out as the official “HTML color name” in a seprate field.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 18, 2020 06:40 AM
What about hex colors that do not have an official html/css name?
You could use a very long switch statement for the most common colors, but there are too many possible color to include every color.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 18, 2020 08:29 AM
That is exactly the dilemma, there are way too many options, hence the “(or the nearest neighbour)”. Ideally 12-15 main colors would do the trick. The purpose is to automatically generate “filter by color”, information that would help to filter those items in online store.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 18, 2020 10:02 AM
I hope you’re not trying to do this in a formula field.
This is the javascript code you want and it will work in a Script Block or a Script Automation. And if Airtable would simply make it possible to call script apps as functions, it could also be a formula. [sigh]

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 18, 2020 06:08 PM
To add to @Bill.French’s JavaScript solution, here’s a reference table you could add to your base for creating cross-references:
Data courtesy of XKCD and Stitch Fix.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 18, 2020 06:35 PM
This is very cool - and doesn’t this mean you could use a formula to perform the lookups pretty easily?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 18, 2020 08:25 PM
I think you could with exact matches, at least — of which there is the possibility for many. However, if “nearest neighbor” matching is still needed beyond the scope of the colors provided here (I’m sure there are millions of actual potential hex-color outputs), there will still be a need for JavaScript. But having all these color references may provide a richer data set for that JavaScript to operate on.
But it’s also possible there are simple rules that govern how hex codes map to color outputs that could be expressed in a JavaScript algorithm — if so, I don’t know what those rules are. :man_shrugging:t2:
I just happened to be in possession of this, rather large, color data set, and discovered this post. Thought it might end up being useful for something here.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 19, 2020 01:44 AM
URTM @Bill.French. I didn’t dare to start playing with this as a formula :winking_face:
Now as a non-coder this looks like Spanish to me. You know, I can manage to order a chicken in Barcelona by looking at the pictures on the menu and then figure out some key words to tell the waiter. :upside_down_face:
But this really helps to get closer to the solution, I’m sure. I will have one of my friends having a look at it and see if we can figure out how to take advantage of the code. Thank you so very much for taking your time to find it and share with us!
