Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgn/kgncolor
A collection of UIColor extensions
https://github.com/kgn/kgncolor
color hex swift ui uikit
Last synced: about 1 month ago
JSON representation
A collection of UIColor extensions
- Host: GitHub
- URL: https://github.com/kgn/kgncolor
- Owner: kgn
- License: mit
- Created: 2015-10-16T14:19:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-20T06:38:58.000Z (over 4 years ago)
- Last Synced: 2024-10-13T03:32:32.110Z (about 1 month ago)
- Topics: color, hex, swift, ui, uikit
- Language: Swift
- Size: 61.5 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KGNColor
`KGNColor` is a collection of helpful `UIColor` extensions.
[![Swift 3](http://img.shields.io/badge/Swift-3-orange.svg)]()
[![Release](https://img.shields.io/github/release/kgn/KGNColor.svg)](/releases)
[![License](http://img.shields.io/badge/License-MIT-lightgrey.svg)](/LICENSE)[![Build Status](https://travis-ci.org/kgn/KGNColor.svg)](https://travis-ci.org/kgn/KGNColor)
[![Test Coverage](http://img.shields.io/badge/Tests-100%25-green.svg)]()
[![Carthage Compatible](https://img.shields.io/badge/Carthage-Compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods Version](https://img.shields.io/cocoapods/v/KGNColor.svg)](https://cocoapods.org/pods/KGNColor)
[![CocoaPods Platforms](https://img.shields.io/cocoapods/p/KGNColor.svg)](https://cocoapods.org/pods/KGNColor)[![Twitter](https://img.shields.io/badge/[email protected])](http://twitter.com/iamkgn)
[![Follow](https://img.shields.io/github/followers/kgn.svg?style=social&label=Follow%20%40kgn)](https://github.com/kgn)
[![Star](https://img.shields.io/github/stars/kgn/KGNColor.svg?style=social&label=Star)](https://github.com/kgn/KGNColor)## 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.
``` Swift
let tintColor = UIColor(hex: 0x2DFF5F)
```### Components
Used this helpful tuple to get the `red`, `green`, `blue` and `alpha` values of a `UIColor`.``` Swift
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
``` Swift
let tintColor = UIColor.red.inverted
```### Lighten a Color
``` Swift
let tintColor = UIColor.blue.lighten(0.5)
```### Darken a Color
``` Swift
let tintColor = UIColor.green.darken(0.5)
```## Progress
- [X] Badges
- [X] Tests
- [X] Travis
- [X] Carthage
- [X] CocoaPods
- [X] Description
- [X] Documentation
- [X] AppleTV
- [X] AppleWatch
- [X] Prebuilt Frameworks
- [ ] Travis Test Matrix