I have a list of colors in HEX format:
String[] validcolors = new String[] { "0055A5", "101010", "E4D200", "FFFFFF", "006563", "A97B3E", "B80000", "6E3391", "D191C3", "D68200", "60823C", "AA8D73", "73A1B8", "6E6D6E", "00582C", "604421" };
And color object:
Color c = ...
I want to find the color that is closest to c in validcolors . Can someone help me? My original idea was “closest to the RGB value”, but everything worked fine.
source share