title: How to convert UIColor RGB Color to uint32_t Value
body: <p>How to convert UIColor object to uint32_t value. Please let me know if any one aware of this?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>const CGFloat *components = CGColorGetComponents([UIColor redColor].CGColor);
     CGFloat r = components[0];
     CGFloat g = components[1];
     CGFloat b = components[2];
    const  uint32_t rgb = ((uint32_t)r &lt;&lt; 16 | (uint32_t)g &lt;&lt; 8 | (uint32_t)b);
  </code></pre>
  
  <p>How to pass 0xFFFFFFFF value in uint32_t?</p>
  
  <pre><code> const uint32_t white = 0xFFFFFFFF, black = 0xFF000000, transp = 0x00FFFFFF;
  </code></pre>