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
| func colorWithGradient(frame: CGRect, colors: [UIColor]) -> UIColor { | |
| // create the background layer that will hold the gradient | |
| let backgroundGradientLayer = CAGradientLayer() | |
| backgroundGradientLayer.frame = frame | |
| // we create an array of CG colors from out UIColor array | |
| let cgColors = colors.map({$0.CGColor}) | |
| backgroundGradientLayer.colors = cgColors |