Skip to content

Instantly share code, notes, and snippets.

@kgn
Created March 15, 2016 07:12
Show Gist options
  • Save kgn/2bcf0d6e4f38d5fe274a to your computer and use it in GitHub Desktop.
Save kgn/2bcf0d6e4f38d5fe274a to your computer and use it in GitHub Desktop.
func tintColor(configData: NSDictionary) -> UIColor? {
guard let tintColor = configData["tint_color"] as? [String: CGFloat] else {
return nil
}
guard let r = tintColor["red"], g = tintColor["green"], b = tintColor["blue"] else {
return nil
}
return UIColor(red: r, green: g, blue: b, alpha: 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment