Created
January 4, 2016 06:28
-
-
Save mortenjust/5b8c150917bc04edbddb to your computer and use it in GitHub Desktop.
hsb, hsba, uicolor
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 getHSBA(color:UIColor) -> (hue:CGFloat, saturation:CGFloat, brightness:CGFloat, alpha:CGFloat) { | |
var hue:CGFloat = 0.0 | |
var sat:CGFloat = 0.0 | |
var bri:CGFloat = 0.0 | |
var alpha:CGFloat = 0.0 | |
color.getHue(&hue, saturation: &sat, brightness: &bri, alpha: &alpha) | |
return (hue:hue, saturation:sat, brightness:bri, alpha:alpha) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment