I want the background color of my cells to change depending on the row. I'm using this code. Why are all cells red?
CGFloat proportion = indexPath.row/(float)rows;
cell.backgroundColor = [UIColor colorWithRed:(proportion*255) green:0.0f blue:0.0f alpha:1.0f];
But if I use this code the color show normally
cell.backgroundColor = [UIColor colorWithWhite:proportion alpha:1.0f];
U count it wrong
U proportion * 255 is bigger than 1
use just proportion