0

I have code that 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 we 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 the screenshots from the iPhone instead of #97D1A1 I have #8AC98B, this colors have difference. #8AC98B, must be #97D1A1#97D1A1

Ideas?

UPDATE

In this small project I have UIView with #97D1A1 background color

Here is screenshot: Screenshot In screenshot I have #89C98A

4

1 に答える 1

0
RGB value of #8AC98B is 138 201 139
RGB value of #97d1a1 is (151,209,161)

あなたはdes値を与えていますか

- (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]];
    // Do any additional setup after loading the view, typically from a nib.
}

plsはこれをプログラムで行い、ビューの色を.xibファイルでクリアに設定します.それは機能します.それは私のために機能します:)

于 2013-07-19T09:20:27.410 に答える