Created
August 3, 2018 06:01
-
-
Save jkmathew/6eddbb58a3fcb768f5068c9a1bfdf998 to your computer and use it in GitHub Desktop.
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
//Just an initial draft | |
func color(for row: Int) -> UIColor { | |
let block = { (row: Int) -> CGFloat in | |
let floatValue = min(CGFloat(row), maxValue) | |
return floatValue / maxValue | |
} | |
let green = block(row) | |
let red = block(10 - row) | |
print("\(row) \(green) \(red)") | |
return UIColor(red: red, green: green, blue: 0, alpha: 1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment