unity代码更改image颜色

像代码将颜色RGB变成这个(230,237,245,255)\

代码如下:

1  if (i % 2 == 0)
2   {
3        CurrentVisitContentObj.GetComponent<Image>().color = Color.white;
4   }
5   else
6   {
7      CurrentVisitContentObj.GetComponent<Image>().color=new Color((230/255f),(237/255f),(245/255f),(255/255f));
8   }
posted @ 2019-03-12 14:36  WalkingSnail  阅读(12417)  评论(1)    收藏  举报