iOS中RGB常用的色值
在設(shè)置顏色是用[UIColor colorWithRed: green: blue: alpha:] 有時(shí)會(huì)遇到顏色不顯示的問(wèn)題
問(wèn)題的所在:RGB的顏色值范圍都是在0.01.0之間的敦迄,并不是0255翩剪。
錯(cuò)誤方法
?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