To set the stage, I have a set of markers. These markers are a "fine" tip about 1mm good for coloring, not good for writing. They are made by Stabilo and they have identifying numbers. I have a total of 52 markers with various numbers on them. My first goal was to find out if the order in which the colors were organized by ID was significant. So I found a swatch online with the colors and the IDs and asked my art friends if they made any sense. The resounding response was "No!" Here's the image I found.
This had the advantage of giving me a name for each color. I snipped each color swatch into its own picture for reference.
I went looking for an authoritative list of colors. Hoping to find something that could tell me what groups each color went into. I found this website. Now I had RGB values for each color in an authoritative list of 100. But none of the names matched.
Next question; do any of the RGB values match? To answer that I needed RGB values for the colors I had. How do I get that? I visited the marker supply website. On that site was a swatch of each pen color. Since it was a website I was able to extract RGB values for each pen. I did this using the inspect feature of Google Chrome.
Ok so now I had RGB values for my pens, and RGB values for an "official" list of colors, but none of the pens matched the colors. As an extra step I went to Stabilo.com and checked out their web site on the 68 pens. They offered a color swatch for a small set of their pens and so I captured those values from their web page. Sadly none of them matched anything else.
The most telling thing was that "Black" which I understand to be (0,0,0) was represented as (36,36,36) which is almost black.
I put all this information into Excel and created a formula to convert from RGB represented as (R,G,B) to RGB represented as #FFFFFF
=CONCATENATE(HEX2DEC(MID(B2,2,2)),",",HEX2DEC(MID(B2,4,2)),",",HEX2DEC(MID(B2,6,2)))
This puts together the 3 pieces based on a value that looks like #D6CFC7
and makes it look like (R,G,B)
But in some cases I had to convert the other direction. So instead of Hex2Dec I used Dec2hex.
So I started searching the internet trying to find a way to compare colors. I discovered that there was a standard, or rather a set of standards that would return a distance between 2 colors.
I found a website where a helpful soul had created a set of Excel macros allowing for easy calculation. However that tool required the colors to be represented in something named "Lab" format. This was new to me. But I learned that one could convert from RGB to XYZ to Lab and so I found a spreadsheet that someone had made so I could do just that. It allowed me to copy and paste in my RGB values and end up with Lab values.
http://www.szintan.hu/boronkay/rgbtocie.xls
Once I had those Lab values I could use the formula.
http://rgbcmyk.com.ar/en/xla-2/
This approach generated a new problem. Now I had a spreadsheet 180x52 with 9,360 values and a need to find the minimum value from the 180 for each of the 52.
I played around with the Excel query tool, even tried using access. Ultimately I simply did each color individually.
For color 11 I found the smallest value, a distance of 9.21 for the color Maya. I used a regular expression text editor to recreate the formula for each color and ultimately found the closest matching color in the list of 180 for each of my 52 pens.
But how could I verify this? How do I get a printable output of each pen color, web color and closest color?
The solution that I decided upon leveraged my limited understanding of HTML. I used a simple online HTML generator to give me a layout of a table. Then used a regular expression text editor to insert a cell for each color. Making that cell's background color the value I'd gotten from the internet.
Then for comparison and reference I included the images I'd created from the color pallet up above.
Now I know to which color group each of my pens belongs.
In reading blog posts about colors I saw more than one site recommend visiting the manufacturer's website to get an idea of how they should be grouped. I didn't have much luck with that, but perhaps other manufacturers are better about that.
No comments:
Post a Comment