@CheckForNull public static String colorToHexString(@Nullable Color color){
  if (color == null) {
    return null;
  }
  return String.format("#%02X%02X%02X",color.getRed(),color.getGreen(),color.getBlue());
}

@ CheckForNull public static String colorToHexString ( @ Nullable Color color ) { if ( color == null ) { return null ; } return String . format ( "#%02X%02X%02X" , color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) ) ; }
convert a color into hex value of form # rrggbb .
