ios - UIColor have wrong value on the screenshot -


i have code set fill color color:

cgcontextsetfillcolor(ctx, cgcolorgetcomponents([uicolorfromrgb(0x0fb803) cgcolor]));  

where uicolorfromrgb is:

#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] 

or can use:

#define uicolor10rgb(r, g, b) [uicolor colorwithred:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] 

but on screenshots iphone instead of #97d1a1 have #8ac98b, colors have difference. #8ac98b, must #97d1a1#97d1a1

ideas?

update

in small project have uiview #97d1a1 background color

here screenshot: screenshot in screenshot have #89c98a

rgb value of #8ac98b 138 201 139 rgb value of #97d1a1 (151,209,161) 

are u giving des values

- (void)viewdidload {     [super viewdidload];     [self.view setbackgroundcolor:[uicolor colorwithred:151.0/255.0 green:209.0/255. blue:161.0/255.0 alpha:1.0f]];     // additional setup after loading view, typically nib. } 

pls programatically , set view color clear in .xib file .it work.it works me :)


Comments