Compare multiple colors
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 i 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 stay 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:
MostCommonColorA compared to MostCommonColorB gives me a difference of 50;
2ndMostCommonColorA compared to 2ndMostCommonColorB gives me a nother difference of 20; .. which is now 70.
If I compare only MostCommonColors, i get 50. So I'd theoretically be picking 50, but thats not really what I want, so how can I weight it properly?
Thanks in advance for the help!
