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 (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-24T09:08:47.000Z (almost 8 years ago)
- Last Synced: 2025-04-18T21:29:23.563Z (3 months ago)
- Topics: carthage, color, kelvin, swift, swift-3, temperature
- Language: Swift
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 0
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KelvinColor
[](https://swift.org)
[](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
```