Created
July 4, 2015 04:40
-
-
Save es-kumagai/aa32d8591334e2703c3f to your computer and use it in GitHub Desktop.
This file contains 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
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