public static String[] filterLightColors(String[] aPalette,int aThreshold){
  List<String> filtered=new ArrayList<String>();
  for (  String color : aPalette) {
    if (!isTooLight(color,aThreshold)) {
      filtered.add(color);
    }
  }
  return (String[])filtered.toArray(new String[filtered.size()]);
}

public static String [ ] filterLightColors ( String [ ] aPalette , int aThreshold ) { List < String > filtered = new ArrayList < String > ( ) ; for ( String color : aPalette ) { if ( ! isTooLight ( color , aThreshold ) ) { filtered . add ( color ) ; } } return ( String [ ] ) filtered . toArray ( new String [ filtered . size ( ) ] ) ; }
filter out too light colors from the palette - those that do not show propely on a ligth background . the threshold controls what to filter .
