double (int argb1, int argb2) { double[] comp = diff(argb1, argb2); // normalize dist to [0..1] return Math.sqrt((comp[0] * comp[0] + comp[1] * comp[1] + comp[2] * comp[2] + comp[3] * comp[3]) / comp.length); }