Soo*_*uNe 2 iphone cocoa-touch uicolor
我正在使用一些颜色,它们似乎根本不正确.附加的图像显示了预期的结果,实际的模拟器和设备上的结果.正如你所看到的那样,Gimp认为RGB(0,16,60)是什么以及我得到的输出是什么[UIColor colorWithRed:0.0 green:16.0 blue:60.0 alpha:1.0];
由于我的alpha是1.0,我不相信我的背景有任何混色.
欢迎任何关于这里发生的事情的建议.alt text http://img200.imageshack.us/img200/3710/picture4uu.png
iPhone结果:
alt text http://img33.imageshack.us/img33/9264/picture3xb.png
几乎所有iPhone OS中的颜色方法都取值为0.0-1.0,而不是0.0-255.0.要获得您在GIMP中看到的颜色,请将每个值除以256; 因此,正确的UIColor方法调用将是[UIColor colorWithRed:0.0 green:0.0625 blue:0.2344 alpha:1.0].