Created
May 8, 2012 14:45
-
-
Save laguiar/2635776 to your computer and use it in GitHub Desktop.
Create UIColor from RGB code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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