title: How can I get a hex string from UIColor or from rgb
body: <p>Now I can convert a hex string to rgb color like this:</p>
  
  <pre><code>// Input is without the # ie : white = FFFFFF
  + (UIColor *)colorWithHexString:(NSString *)hexString
  {
      unsigned int hex;
      [[NSScanner scannerWithString:hexString] scanHexInt:&amp;hex];
      int r = (hex &gt;&gt; 16) &amp; 0xFF;
      int g = (hex &gt;&gt; 8) &amp; 0xFF;
      int b = (hex) &amp; 0xFF;
  
      return [UIColor colorWithRed:r / 255.0f
                          green:g / 255.0f
                          blue:b / 255.0f
                          alpha:1.0f];
  }
  </code></pre>
  
  <p>bu how can I convert rgb to hex string? </p>