IOS开发资料大全IT界

ios开发常用RGB色值

2016-10-03  本文已影响153人  许威彬

iOS中RGB常用的色值

在设置颜色是用[UIColor colorWithRed: green: blue: alpha:] 有时会遇到颜色不显示的问题
问题的所在:RGB的颜色值范围都是在0.01.0之间的,并不是0255。

错误方法
❌cell.temperature.backgroundColor = [UIColor colorWithRed:226 green:229 blue:229 alpha:1];
正确方法:
✅cell.temperature.backgroundColor = [UIColor colorWithRed:226.0/255 green:229.0/255 blue:229.0/255 alpha:1];  
IOS常用色值1.png
IOS常用色值2.png
上一篇下一篇

猜你喜欢

热点阅读