ios开发常用RGB色值

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开发常用RGB色值_第1张图片
IOS常用色值1.png

ios开发常用RGB色值_第2张图片
IOS常用色值2.png

你可能感兴趣的:(ios开发常用RGB色值)