Created
August 18, 2014 14:52
-
-
Save ahknight/d2bee8283c3173146ebc to your computer and use it in GitHub Desktop.
Hex to UIColor
This file contains hidden or 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 UICOLOR_FROM_HEX(x) [UIColor colorWithRed:(((NSUInteger)(x & 0xff0000) >> 16)/255.) \ | |
green:(((NSUInteger)(x & 0x00ff00) >> 8)/255.) \ | |
blue:(((NSUInteger)(x & 0x0000ff))/255.) \ | |
alpha:1.0] | |
UIColor *color = UICOLOR_FROM_HEX(0xff00ff); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment