Latest 1.1
Homepage https://github.com/devcarlos/UIColor-HexUtils
License MIT
Platforms ios , requires ARC
Authors

UIColor+HexUtils

Badge w/ Version
Badge w/ Version
Badge w/ Version

UIColor+HexUtils is a category for Hexadecimal Colors Support for UIColor. Support for prefixed # (#FFFFFF) or without (FFFFFF) Hexadecimal Colors.

RELEASE 1.1

Updated Demo Project for CocoaPods and Fixes.

RELEASE 1.0

The base UIColor+Hex category with the required hex transformation functions.

Examples

Objective-c

// with hash
UIColor *colorHash = [UIColor colorWithHex:@"#FFFFFF"];

// without hash
UIColor *colorNoHash = [UIColor colorWithHex:@"FFFFFF"];

// short Hex
UIColor *colorShort = [UIColor colorWithHex:@"#FFF"];

swift

// with hash
let colorHash = UIColor.colorWithHex("#FFFFFF")

// without hash
let colorNoHash = UIColor.colorWithHex("FFFFFF")

// short Hex
let colorShort = UIColor.colorWithHex("#FFF")

Demo Project

Check on Demo Directory for the Demo Project

Installation

CocoaPods

platform  :ios

target 'YourTarget' do
  pod 'UIColor-HexUtils', :git => "https://github.com/devcarlos/UIColor-HexUtils.git"
end
  • #import "UIColor+HexUtils.h" where you want to use UIColor+HexUtils category functions

Requirements

UIColor+HexUtils requires iOS 5.0 and above.

Credits

UIColors+HexUtils was created by Carlos Alcala because I was using in a lot of projects and wanted to contribute (and avoid the pain to always search for this functionality).

Creator

Carlos Alcala @carlosalcala

License

UIColors+HexUtils is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UIColor-HexUtils",
    "version": "1.1",
    "summary": "A custom UIColor Hex Utils Category",
    "homepage": "https://github.com/devcarlos/UIColor-HexUtils",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Carlos Alcala": "[email protected]"
    },
    "social_media_url": "http://twitter.com/carlosalcala",
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/devcarlos/UIColor-HexUtils.git",
        "tag": "1.1"
    },
    "source_files": [
        "Classes",
        "Classes/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This