kgn / KGNColor

A collection of UIColor extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KGNColor

KGNColor is a collection of helpful UIColor extensions.

Swift 3 Release License

Build Status Test Coverage Carthage Compatible CocoaPods Version CocoaPods Platforms

Twitter Follow Star

Installing

Carthage

github "kgn/KGNColor"

CocoaPods

pod 'KGNColor'

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.brown
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.red.inverted

Lighten a Color

let tintColor = UIColor.blue.lighten(0.5)

Darken a Color

let tintColor = UIColor.green.darken(0.5)

Progress

  • Badges
  • Tests
  • Travis
  • Carthage
  • CocoaPods
  • Description
  • Documentation
  • AppleTV
  • AppleWatch
  • Prebuilt Frameworks
  • Travis Test Matrix

About

A collection of UIColor extensions

License:MIT License


Languages

Language:Swift 86.8%Language:Ruby 7.0%Language:Objective-C 6.2%