@Deprecated public static byte matchColor(Color color){
  if (color.getAlpha() < 128)   return 0;
  int index=0;
  double best=-1;
  for (int i=4; i < colors.length; i++) {
    double distance=getDistance(color,colors[i]);
    if (distance < best || best == -1) {
      best=distance;
      index=i;
    }
  }
  return (byte)(index < 128 ? index : -129 + (index - 127));
}

@ Deprecated public static byte matchColor ( Color color ) { if ( color . getAlpha ( ) < 128 ) return 0 ; int index = 0 ; double best = - 1 ; for ( int i = 4 ; i < colors . length ; i ++ ) { double distance = getDistance ( color , colors [ i ] ) ; if ( distance < best || best == - 1 ) { best = distance ; index = i ; } } return ( byte ) ( index < 128 ? index : - 129 + ( index - 127 ) ) ; }
get the index of the closest matching color in the palette to the given color .
