UIColor limitations or bugs on iPhone 3.0

I am working with some colors and they don't seem to be correct. The attached images show the expected result as well as the actual simulator and the result on the device. As you can see, it looks like there is a difference between what the Gimp considers RGB (0, 16, 60) and what I get from[UIColor colorWithRed:0.0 green:16.0 blue:60.0 alpha:1.0];

Since my alpha is 1.0, I don't believe I have color mixing with the background.

Any suggestions on what is going on here are greatly appreciated. alt text http://img200.imageshack.us/img200/3710/picture4uu.png

iPhone Result:

alt text http://img33.imageshack.us/img33/9264/picture3xb.png

+2


source to share


1 answer


Almost every color method in iPhone OS takes a value from 0.0-1.0, not 0.0-255.0. To get the color you are viewing in GIMP, divide each of your values ​​by 256; thus, the correct call to the UIColor method would be [UIColor colorWithRed:0.0 green:0.0625 blue:0.2344 alpha:1.0]

.



+7


source







All Articles