I have RGB for setting colour of my label
it is like this R-:0 G:-78 B-255 开发者_运维知识库and hash code is #004eff
can u tell me how to give this to my label as under below
UILabel *label;
UIColor takes RGB values as a float between 0.0 and 1.0. To get that from a value between 0 and 255, you need to divide by 255.
[myLabel setTextColor:[UIColor colorWithRed:0/255.0 green:78/255.0 blue:255/255.0 alpha:1.0]];
You may want to write a category method that does this for you, or even a simple preprocessor macro.
精彩评论