可以定义到头文件里。
// 根据16位RBG值转换成颜色,格式:KLColorFrom16RGB(0xFF0000)
#define KLColorFrom16RGB(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]// 根据10位RBG值转换成颜色, 格式:KLColorFrom10RBG(255,255,255)
#define KLColorFrom10RGB(RED, GREEN, BLUE) [UIColor colorWithRed:RED/255.0 green:GREEN/255.0 blue:BLUE/255.0 alpha:1.0]