Skip to content

Instantly share code, notes, and snippets.

@jeksys
Created February 4, 2015 21:51
Show Gist options
  • Save jeksys/8381377062364ab19379 to your computer and use it in GitHub Desktop.
Save jeksys/8381377062364ab19379 to your computer and use it in GitHub Desktop.
uicolorFromHex.swift
func uicolorFromHex(rgbValue:UInt32)->UIColor{
let red = CGFloat((rgbValue & 0xFF0000) >> 16)/256.0
let green = CGFloat((rgbValue & 0xFF00) >> 8)/256.0
let blue = CGFloat(rgbValue & 0xFF)/256.0
return UIColor(red:red, green:green, blue:blue, alpha:1.0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment