Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/djben/kelvincolor
Black body temperature to color in Swift.
https://github.com/djben/kelvincolor
carthage color kelvin swift swift-3 temperature
Last synced: 2 months ago
JSON representation
Black body temperature to color in Swift.
- Host: GitHub
- URL: https://github.com/djben/kelvincolor
- Owner: DJBen
- License: mit
- Created: 2017-08-24T08:31:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-24T09:08:47.000Z (over 7 years ago)
- Last Synced: 2024-11-14T22:05:49.864Z (2 months ago)
- Topics: carthage, color, kelvin, swift, swift-3, temperature
- Language: Swift
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KelvinColor
[![Language](https://img.shields.io/badge/Swift-3.1-orange.svg?style=flat)](https://swift.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)_Black body temperature to color in swift._
## Installation
### Carthage
Add the following in your project's [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md):
github "DJBen/KelvinColor" ~> 0.1.0
## Usage
Temperature to color and color to temperature methods are extensions of `UIColor` class. No other classes are required!
1. Kelvin to `UIColor`
```swift
UIColor.init(temperature: 6500)
// (255, 249, 253)
```
2. UIColor to Kelvin```swift
color.temperature
```