Check out the code
const CGFloat *c = CGColorGetComponents([[UIColor whiteColor] CGColor]);
slider1.value = c[0];
slider2.value = c[1];
slider3.value = c[2];
c[2] is getting 0. For whiteColor all RGB values shld be 1.0. Why its not returning correct value for the blue component?
Any code snippet? for getting RGB values from white color?
Try CGColorGetColorSpace([[UIColor whiteColor] CGColor])
You will see it is not RGB. It has 2 components only: greyscale and alpha
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With