Can give different color in CGContextSetRGBFillColor?
صفحه اصلي

Can give different color in CGContextSetRGBFillColor?



How can I give the color HEXCOLOR(0xe3f3fbff) in CGContextSetRGBFillColor?


does using try catch block in xcode show error on real device?

1:

for- loop in background thread accesses each index more than once — iPhone dev
Try. Update coordinate property of MKAnnotation on parent viewcontroller after Touch End event?
CGContextSetRGBFillColor(context, 0xe3 / 255.0, 0xf3 / 255.0, 0xfb / 255.0, 0xff / 255.0); 
Memory Management Question in Objective CUITableView frame height animation glitch

2:

Should a property list be managed by its own model object?
CGContextSetRGBFillColor requires CGFloat values for R,G,B and alpha (from 0.0 to 1.0), so you'll have to convert every component of the hex color to values between 0.0 and 1.0.. How to remove NSString Related Memory Leaks? In your case:. XCode, iPhone, WebKit Framework - What am I missing?
// R = 0xe3 / 0xff = 0.890 // G = 0xf3 / 0xff = 0.953 // B = 0xfb / 0xff = 0.984 // A = 0xff / 0xff = 1.000  CGContextSetRGBFillColor(context,0.89,0.953,0.984,1.0); 
You must convert your hex color string to r,g,b,a values like this:.
NSString  *color = @"0xe3f3fbff";  unsigned r,g,b,a;  [[NSScanner scannerWithString:[color substringWithRange:NSMakeRange(2,2)]] scanHexInt:&r]; [[NSScanner scannerWithString:[color substringWithRange:NSMakeRange(4,2)]] scanHexInt:&g]; [[NSScanner scannerWithString:[color substringWithRange:NSMakeRange(6,2)]] scanHexInt:&b]; [[NSScanner scannerWithString:[color substringWithRange:NSMakeRange(7,2)]] scanHexInt:&a];  CGContextSetRGBFillColor(context,r/255.0,g/255.0,b/255.0,a/255.0); 


68 out of 100 based on 63 user ratings 578 reviews

*