Created
March 28, 2011 19:32
-
-
Save dstnbrkr/891109 to your computer and use it in GitHub Desktop.
Convert hex value to UIColor
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
UIColor* UIColorFromRGB(NSInteger rgb) { | |
return [UIColor colorWithRed:((float) ((rgb & 0xFF0000) >> 16)) / 0xFF | |
green:((float) ((rgb & 0xFF00) >> 8)) / 0xFF | |
blue:((float) (rgb & 0xFF)) / 0xFF | |
alpha:1.0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment