Latest 1.0.5
Homepage https://github.com/keisukeYamagishi/SHColor
License MIT
Platforms ios 8.0
Authors

SHColor
SHColor
SHColor

Overview

Convert hexadecimal string to UIColor with r g b value. 😏
extention of UIColor
It can be used as UIColor as it can be used as.

For example :)

FFAA 02 => UIColor

Installation

Cocoapods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate GMSDirection into your Xcode project using CocoaPods, specify it in your Podfile:

vi ./Podfile

If you do not have the google map SDK for iOS

target 'MyApp' do
  pod 'SHColor'
end

Then, run the following command:

$ pod setup
$ pod install

Use it

Via SSH: For those who plan on regularly making direct commits, cloning over SSH may provide a better experience (which requires uploading SSH keys to GitHub):

$ git clone [email protected]:keisukeYamagishi/SHColor.git

Via https: For those checking out sources as read-only, HTTPS works best:

$ git clone https://github.com/keisukeYamagishi/SHColor.git

Sample code

self.view.backgroundColor = UIColor(hex: "5AC8FA")

Even if the prefix has a #, you can convert it.

self.view.backgroundColor = UIColor(hex: "#5AC8FA")
self.view.backgroundColor = UIColor(hex: "#5ac8fa")

Passing an invalid character string returns 0.

self.view.backgroundColor = UIColor(hex: "#😏😏😏😏😏😏")

Latest podspec

{
    "name": "SHColor",
    "version": "1.0.5",
    "summary": "Convert hexadecimal to UIColor",
    "description": "Convert hexadecimal to UIColor",
    "homepage": "https://github.com/keisukeYamagishi/SHColor",
    "license": "MIT",
    "authors": {
        "keisuke": "[email protected]"
    },
    "source": {
        "git": "https://github.com/keisukeYamagishi/SHColor.git",
        "tag": "1.0.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": [
        "Source",
        "Pods/SHColor/Source/*.swift"
    ]
}

Pin It on Pinterest

Share This