public String pickColor(final Shell shell,final RGB initialColor){
  Check.notNull(shell,"shell");
  final ColorDialog dialog=new ColorDialog(shell);
  if (initialColor != null) {
    dialog.setRGB(initialColor);
  }
  final RGB rgb=dialog.open();
  if (rgb != null) {
    return String.format("#%1$02x%2$02x%3$02x",rgb.red,rgb.green,rgb.blue);
  }
  return null;
}

public String pickColor ( final Shell shell , final RGB initialColor ) { Check . notNull ( shell , "shell" ) ; final ColorDialog dialog = new ColorDialog ( shell ) ; if ( initialColor != null ) { dialog . setRGB ( initialColor ) ; } final RGB rgb = dialog . open ( ) ; if ( rgb != null ) { return String . format ( "#%1$02x%2$02x%3$02x" , rgb . red , rgb . green , rgb . blue ) ; } return null ; }
opens a dialog to let the user pick a color .
