I covered the mathematics of color matching in the VBA implementation in Find nearest color match. This is the Google Apps Script implementation. I'll be using the CIEDE2000 algorithm to measure the distance between colors.
The source and data are the heatMap workbook described in Playing around with GAS color, and much use is made of a shared library, see - Using the mcpher library in your code
In Looking up color table I've built up a table of schemes such as Pantone, dulux etc through various web scraping sessions, and now have getting on for 10,000 named colors in that library. Here's the GAS attempt at finding the closest matches to some random colors in a couple of the color schemes.
These are implemented in Playing around with GAS color. Here's the color match algorithm section.
and here' the test procedure that generated the above
For help and more information join our forum,follow the blog or follow me on twitter .
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > From VBA to Google Apps Script >