Latest 1.0.1
Homepage https://github.com/ustwo/image-color-swift
License MIT
Platforms ios 8.3, requires ARC
Authors ,

License
Build Status
codecov.io

UIImage+Color.swift

An iOS helper class for creating a UIImage from a UIColor.

Dependencies

Installation

CocoaPods

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

$ gem install cocoapods

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

platform :ios, '8.3'

use_frameworks!

pod 'UIImageColorSwift', '~> 1.0.1'

Then, run the following command:

$ pod install

Manually

  • Add the UIImage+Color.swift file from the Sources folder to your Xcode project.

Usage

For creating a UIImage from a UIColor

let image = UIImage.imageFromColor(UIColor.blue)

// Applying the image to the background of a UIButton

button.setBackgroundImage(image, forState: .normal)

To specify the size of the image:

let image = UIImage.imageFromColor(UIColor.blue, width: 1.0, height: 2.0)

Contributing

Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms. See the Code of Conduct file.

Maintainers

License

UIImageColorSwift is released under the MIT License. See License.

Latest podspec

{
    "name": "UIImageColorSwift",
    "version": "1.0.1",
    "license": "MIT",
    "summary": "An iOS helper class for creating a UIImage from a UIColor.",
    "homepage": "https://github.com/ustwo/image-color-swift",
    "authors": {
        "Shagun Madhikarmi": "[email protected]",
        "Daniela Dias": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ustwo/image-color-swift.git",
        "tag": "v1.0.1"
    },
    "platforms": {
        "ios": "8.3"
    },
    "source_files": "Sources/*.swift",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This