How to compare multiple colors to one another
Hi,
Im currently writing a script for Photoshop in Extendscript. Now Im trying to figure out, how to compare colors to each other. I've mostly tried to stick to wikipedias article about comparing colors and using a weighed eucledian algorithm to get a distance which indicates their difference. Comparing 2 colors is no problem with that.
But in my script I have 3 Inputs (Most common color, second most common color, and the third most common color). Now if I want to compare this to their aquivalent part, lets say I have a Main_tile with their 3 Inputs and a Tile_file with 3 Inputs, I can compare (Common to common, second common to second common..), which seems to work fine.
My question is what happens if my Tile_file has only 1 Input, how do I compare it to the Main_tile?
Example: 3 Main, 1 Tile color given. I could pick the most common main color only and compare most common to most common but this number would always be lower than comparing 3x3 colors to one another, so I would pick the lowest number, hence the lowest color difference, which is not really what I want. Any ideas on this topic?
I tried to make everything clear, but if theres something unclear just tell me!
Thanks in advance for the help!
