private static String parseRGB(String[] gradients){
  StringBuilder rrggbbBuilder=new StringBuilder();
  String gradient;
  int percent_loc;
  double value;
  for (int i=0; i < NUM_FUNC_RGB_GRADIENT; i++) {
    gradient=gradients[i];
    gradient=removeSpace(gradient);
    if ((percent_loc=gradient.lastIndexOf(PERCENT)) != -1) {
      gradient=gradient.substring(0,percent_loc);
      value=Double.parseDouble(gradient) / PERCENT_CONVERT;
      rrggbbBuilder.append(String.format(HEX_FORMAT,(int)(COLOR_RANGE * value)));
    }
 else {
      rrggbbBuilder.append(String.format(HEX_FORMAT,Integer.parseInt(gradient)));
    }
  }
  return rrggbbBuilder.toString();
}

private static String parseRGB ( String [ ] gradients ) { StringBuilder rrggbbBuilder = new StringBuilder ( ) ; String gradient ; int percent_loc ; double value ; for ( int i = 0 ; i < NUM_FUNC_RGB_GRADIENT ; i ++ ) { gradient = gradients [ i ] ; gradient = removeSpace ( gradient ) ; if ( ( percent_loc = gradient . lastIndexOf ( PERCENT ) ) != - 1 ) { gradient = gradient . substring ( 0 , percent_loc ) ; value = Double . parseDouble ( gradient ) / PERCENT_CONVERT ; rrggbbBuilder . append ( String . format ( HEX_FORMAT , ( int ) ( COLOR_RANGE * value ) ) ) ; } else { rrggbbBuilder . append ( String . format ( HEX_FORMAT , Integer . parseInt ( gradient ) ) ) ; } } return rrggbbBuilder . toString ( ) ; }
parse functional rgb to rrggbb mode
