const CGFloat *color = CGColorGetComponents([[UIColor whiteColor] CGColor]);
CGContextSetFillColor(context, color);
I have black background. While working this above code not sure whats wrong most of the colors work like redColor, purpleColor, greenColor, yellowColor
but whiteColor, grayColor does not work. when i use whiteColor screen looks empty.
whiteColorandgreyColorhave colorspace different fromredColor,purpleColoretc (I guess gray and rgb correspondently) and CGContextSetFillColor requires that appropriate color space is set (using CGContextSetFillColorSpace). Note also that docs say that prefered method to set fill color isCGContextSetFillColorWithColorfunction.