Created
December 10, 2015 15:21
-
-
Save soggybag/36e5705926ee1c7ab9f7 to your computer and use it in GitHub Desktop.
Colored Cells, cells changed brightness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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