开发者

iPhone - is CGContextSetStrokeColorWithColor not creating wanted color?

I am having some weird troubles with drawing some lines in an application. My drawRect is using

CGContextRef context = UIGraphicsGetCurrentConte开发者_如何学Cxt();
CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:57 green:172 blue:255 alpha:1].CGColor]);
CGContextSetAlpha(context, 0.8);
CGContextSetLineWidth(context, POLYLINE_WIDTH);

The color that is supposed to be shown is something like this. However I am getting a dark grey color, does anyone know why this color could be getting skewed?


Try

CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:57 / 255 green:172 / 255 blue:255 / 255 alpha:1].CGColor]);

These functions are expecting a number from 0-1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜