Skip to content
forked from aleclarson/hex-kit

Convert hex triplets into UIColors and CGColors!

License

Notifications You must be signed in to change notification settings

Radther/hex-kit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

A simple library for converting a hex triplet (represented by a String) into a UIColor or CGColor!

let myUIColor = "#FFFFFF".UIColor
let myCGColor = "#FFFFFF".CGColor

Specifying the color's alpha is very simple.

let myUIColor = "#FFFFFF".UIColor(0.5)

Abbreviations for colors are allowed and typing a hash # is optional.

Here are the supported formats:

"#123456"

"123456"

"#123" // Represents "#112233"

"123"

"#12" // Represents "#121212"

"12"

"#F" // Represents "#FFFFFF"

"F"

Just add the Hexes.swift file to your project, and you're good to go! Enjoy!

About

Convert hex triplets into UIColors and CGColors!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%