CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

KGNColor 0.1.4

KGNColor 0.1.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2015
SPMSupports SPM

Maintained by David Keegan.



KGNColor 0.1.4

  • By
  • David Keegan

KGNColor

KGNColor is a collection of helpful UIColor extensions.

Installing

Examples

Hex Initializer

Using a hex value is often the easiest way to use the exact color from a design.

let tintColor = UIColor(hex: 0x2DFF5F)

Components

Used this helpful tuple to get the red, green, blue and alpha values of a UIColor.

let tintColor = UIColor.brownColor()
print("red: \(tintColor.components.red)")
print("green: \(tintColor.components.green)")
print("blue: \(tintColor.components.blue)")
print("alpha: \(tintColor.components.alpha)")

Invert a Color

let tintColor = UIColor.redColor().invert()

Lighten a Color

let tintColor = UIColor.blueColor().lighten(0.5)

Darken a Color

let tintColor = UIColor.greenColor().darken(0.5)

Progress

  • [X] Badges
  • [X] Tests
  • [X] Travis
  • [X] Carthage
  • [X] CocoaPods
  • [X] Description
  • [X] Documentation