I have this macro in my header file:
#define UIColorFromRGB(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]
And I am using this as something like this in my .m file:
cell.textColor = UIColorFromRGB(0x663333);
So I want to ask everyone is this better or should I use this approach:
cell.textColor = [UIColor colorWithRed:66/255.0
green:33/255.0
blue:33/255.0
alpha:1.0];
Which one is the better approach?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…