Skip to content

Instantly share code, notes, and snippets.

@tony0x59
Last active December 19, 2015 01:19
Show Gist options
  • Save tony0x59/5874562 to your computer and use it in GitHub Desktop.
Save tony0x59/5874562 to your computer and use it in GitHub Desktop.
UIColor便捷设置
#define UIColorFromHexRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define UIColorFrom8BitRGB(r, g, b) [UIColor \
colorWithRed:(r)/255.0 \
green:(g)/255.0 \
blue:(b)/255.0 alpha:1.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment