Latest 1.0
Homepage https://github.com/aleclarson/hex-kit
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit

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!

Latest podspec

{
    "name": "Hexes",
    "version": "1.0",
    "summary": "Convert hex triplets into UIColors and CGColors!",
    "homepage": "https://github.com/aleclarson/hex-kit",
    "authors": "Alec Larson",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "source": {
        "git": "https://github.com/ProjectDent/hex-kit.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Hexes.swift",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This