Skip to content

Instantly share code, notes, and snippets.

@soggybag
Created December 10, 2015 15:21
Show Gist options
  • Save soggybag/36e5705926ee1c7ab9f7 to your computer and use it in GitHub Desktop.
Save soggybag/36e5705926ee1c7ab9f7 to your computer and use it in GitHub Desktop.
Colored Cells, cells changed brightness.
// Somewhere inside of cellForRowAtIndexPath
// Or, set the brightness. Here the min value is 0.55 and max value is 1.0 (0.45 + 0.55)
let b = 0.45 / CGFloat(array.count) * CGFloat(indexPath.row) + 0.55
cell.backgroundColor = UIColor(hue: 0.5, saturation: 1.0, brightness: b, alpha: 1.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment