iOS中RGB常用的色值,同時可將對顏色的設置定義成宏,方便開發應用,如:
- //?@name?顏色相關??
- // 參數格式為:0xFFFFFF??
- #define?kColorWithRGB(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]??
- // 參數格式為:222,222,222??
- #define?kColorWithRGB(r,?g,?b)?[UIColor?colorWithRed:(r)?/?255.f?green:(g)?/?255.f?blue:(b)?/?255.f?alpha:1.f]??
- //?@end??