项目作者: jathu

项目描述 :
A color extension for Swift with Photoshop blending.
高级语言: Swift
项目地址: git://github.com/jathu/sweetercolor.git
创建时间: 2015-08-18T23:13:37Z
项目社区:https://github.com/jathu/sweetercolor

开源协议:MIT License

下载


Sweetercolor

Sweetercolor

A color extension library for Swift.*

*It has Photoshop style color blending!

Example

  1. // Example of hex initializer
  2. let sun = UIColor(hex: "#FBF002")
  3. // Example of RGB 0-255 initializer
  4. let pink = UIColor(r: 241, g: 139, b: 185)
  5. let container = UIView(frame: CGRect(x: 0, y: 0, width: 888, height: 250))
  6. container.backgroundColor = pink
  7. let label = UILabel(frame: container.frame)
  8. label.text = "Sweet"
  9. label.textColor = sun
  10. // Example of overlay similar to Photoshop with reduced alpha
  11. // This allows us to get a more natural ambient shadow
  12. label.layer.shadowColor = pink.overlayBlack.with(alpha: 0.6).cgColor

Example Preview

Installation

You can either directly copy Sweetercolor.swift into your project or you can use CocoaPods: Sweetercolor.

Documentation

Each method is documented using headerdocs. An overview can be found here: jathu.me/sweetercolor

License

The license is provided in the project folder.

The logo and name is based off of Sweeterman by Ramriddlz. The original logo is based on the Chiquita logo.


August 2015 - Toronto