Skip to content

Instantly share code, notes, and snippets.

@es-kumagai
Created July 4, 2015 04:40
Show Gist options
  • Save es-kumagai/aa32d8591334e2703c3f to your computer and use it in GitHub Desktop.
Save es-kumagai/aa32d8591334e2703c3f to your computer and use it in GitHub Desktop.
protocol FloatingType {
var floatValue:Double { get }
}
extension CGFloat : FloatingType {
var floatValue:Double {
return self.native
}
}
extension Array where T : FloatingType {
func color() -> UIColor {
return UIColor(red:CGFloat(self[0].floatValue), green:1.0, blue:1.0, alpha:1.0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment