Last active
August 29, 2015 14:07
-
-
Save tfrank64/f1a03028920c099b12d7 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
/// Method that returns a slightly lighter color than the one passed in | |
/// | |
/// :param: color color is the color we want to make ligter | |
/// :returns: The lighter color | |
func lighterColorForColor(color: UIColor) -> UIColor { | |
var r:CGFloat = 0, g:CGFloat = 0, b:CGFloat = 0, a: CGFloat = 0 | |
if color.getRed(&r, green: &g, blue: &b, alpha: &a) { | |
return UIColor(red: min(r + colorShadeDifference, 1.0), green: min(g + colorShadeDifference, 1.0), blue: min(b + colorShadeDifference, 1.0), alpha: a) | |
} | |
return color | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment