Swift implementation of HSLuv (revision 4)
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Extensions
HSLuvSwift.xcodeproj
HSLuvSwift.xcworkspace
HSLuviOS.playground
Source
Tests
.gitignore
.swiftlint.yml
.travis.yml
.xctool-args
HSLuvSwift.podspec
LICENSE
README.md

README.md

HSLuvSwift

Cocoapod compatible Carthage compatible Build Status MIT License

Swift port of HSLuv (revision 4), courtesy of Clay Smith

Explanation, demo, ports etc.

USAGE

This framework adds a single initializer on the OS-specific color class to create a color from HSLuv parameters. The initializer takes the same parameters on both OSX and iOS.

// OSX
let color = NSColor(hue: 360.0, saturation: 100.0, lightness: 100.0, alpha: 1.0)

// iOS
let color = UIColor(hue: 360.0, saturation: 100.0, lightness: 100.0, alpha: 1.0)

INSTALL

This project is compatible with CocoaPods and Carthage. (These instructions assume that your chosen method is already installed.)

CocoaPods

Add pod 'HSLuvSwift' to your target. Since this is a Swift dynamic framework, you must also tell CocoaPods to use_frameworks! instead of static libraries.

platform :ios, '8.0' # or, :osx, '10.10'
use_frameworks!

target 'YourProject' do
pod 'HSLuvSwift', '~> 2.0.0'
end

Carthage

Add github "hsluv/hsluv-swift" ~> 2.0.0 to your Cartfile and run carthage bootstrap. This builds frameworks for Mac and iOS targets.

> echo 'github "hsluv/hsluv-swift" ~> 2.0.0' >> Cartfile
> carthage bootstrap

TODO

  • Finish HPLuv implementation
  • Improve tests and add continuous integration testing
  • Add Carthage instructions
  • Add usage documentation

License

See License