Skip to content

Instantly share code, notes, and snippets.

@laguiar
Created May 8, 2012 14:45
Show Gist options
  • Save laguiar/2635776 to your computer and use it in GitHub Desktop.
Save laguiar/2635776 to your computer and use it in GitHub Desktop.
Create UIColor from RGB code
#define PercentColor(a) (float)((float)a / 255.0f)
#define UIColorFromRGB(r, g, b, a) [UIColor colorWithRed:PercentColor(r) green:PercentColor(g) blue:PercentColor(b) alpha:PercentColor(a)*255.0f]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment