Skip to content

Extension for UIColor in UIKit to create a colour from a hex string.

License

Notifications You must be signed in to change notification settings

philackm/colorFromHex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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")

About

Extension for UIColor in UIKit to create a colour from a hex string.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages