Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 391 Bytes

readme.md

File metadata and controls

9 lines (5 loc) · 391 Bytes

colorFromHex

A simple extension written in Swift for UIColor in UIKit which adds a class function that returns a UIColor from the provided hex string. The colours are cached.

Usage

Parameters: hexString: String, the hex code for the color you want. Leading "#" is optional. Must be 6 hexadecimal digits long. (8 bits per color)

let someColor = UIColor.colorFromHex("#2d34aa")