/**
* Calculates distance in RGB color space with Euklidian distance between each component
*
* @param c1 {@link Color} one
* @param c2 {@link Color} two
* @return double result of comparison. Max possible distance is 225.0. Minimum 0.0
*/
public static double colorDistance( Color c1, Color c2 )
{
double rDist = c1.getRed() - c2.getRed();
double gDist = c1.getGreen() - c2.getGreen();
double bDist = c1.getBlue() - c2.getBlue();
return Math.sqrt( rDist * rDist + gDist * gDist + bDist * bDist )/* / SQRT_3*/;
}//end color distance method
...
Random rnd = new Random();
for ( int i = 0; i < 50; i++ )
System.out.println( String.format( Locale.US, "+++ #%2d: %5.2f", i+1, rnd.nextDouble() * 100.0d ) );
...