Latest 0.1.2
Homepage https://github.com/patoman007/HSBColorWheelPicker
License MIT
Platforms ios 8.3
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Requirements

iOS 8.0

Installation

The easiest way to use HSBColorWheelPicker is with CocoaPods.
Add the following line to your Podfile.

pod "HSBColorWheelPicker"

Otherwise you need to include the following files into your project:

  • ColorWheel.swift
  • ColorView.swift

Usage

HSBColorWheelPicker is optimized for Interface Builder and AutoLayout.

  1. On the storyboard drag an UIView into a View Controller.
  2. Set HSBColorWheel as class of UIView.
  3. On the ViewController implmentation import the HSBColorWheelPicker framework.
  4. Make a connection between HSBColorWheel view and View Controller.
  5. Implement the HSBColorWheelDelegate protocol on the View Controller.
    Just only one method: colorWheel(_ colorWheel:HSBColorWheel, didSelectColor color:UIColor)
  6. Set View Controller as delegate of HSBColorWheel view
  7. Ready to use it.

Changing the UI components

You can customize the user interface changing the following values

- @IBInspectable public var colorSize:CGFloat
- @IBInspectable public var wheelDivisions:Int
- @IBInspectable public var colorSeparation:CGFloat
- @IBInspectable public var showWheelEdge:Bool
- @IBInspectable public var wheelEdgeColor:UIColor
- @IBInspectable public var wheelEdgeWidth:CGFloat
- @IBInspectable public var showDivisions:Bool
- @IBInspectable public var divisionsColor:UIColor
- @IBInspectable public var divisionsWidth:CGFloat
- @IBInspectable public var showColorEdge:UIColor
- @IBInspectable public var colorEdgeWidth:CGFloat
- @IBInspectable public var colorEdgeColor:UIColor
- @IBInspectable public var showSelectedColor:Bool

Without Interface Builder

As shown below, you can also programmatically customize HSBColorWheelPicker

let frame = CGRect(x: 0, y: 0, width: 320, height: 320)
let colorWheel = HSBColorWheel(frame: frame)
colorWheel.colorSize = 33
colorWheel.wheelDivisions = 11
colorWheel.colorSeparation = 2
colorWheel.showWheelEdge = true
colorWheel.showDivisions = true
colorWheel.showColorEdge = true

view.addSubview(colorWheel)

Default values

- colorSize = 20
- wheelDivisions = 4
- colorSeparation = 1
- showWheelEdge = false
- wheelEdgeColor = black
- wheelEdgeWidth = 1.0
- showDivisions = false
- divisionsColor = black
- divisionsWidth = 1.0
- showColorEdge = true
- colorEdgeWidth = 0.5
- colorEdgeColor = black
- showSelectedColor = true

Screenshots

alt tag
Change values using Interface Builder

alt tag
Color wheel with edge and division lines

alt tag
Color wheel without edge and division lines

alt tag

  • Separation lines width: 20dp
  • Separation lines color: black with 0.5 alpha

alt tag

  • Separation lines width: 35dp
  • Separation lines color: black with 0.75 alpha

alt tag

Author

Patricio Aguirre – [email protected] – @patoman007

License

HSBColorWheelPicker is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "HSBColorWheelPicker",
    "version": "0.1.2",
    "summary": "HSBColorWheelPicker is a lightweight color picker for iOS that it is easy ton                        use for both users and developers",
    "description": "An open-source iOS color picker with HSL wheel.nSupports all resolutions, orientations and devices.nPick color by color wheel with saturation and lightness bars",
    "homepage": "https://github.com/patoman007/HSBColorWheelPicker",
    "screenshots": [
        "https://cloud.githubusercontent.com/assets/6759634/22859175/f60a03f8-f0b1-11e6-9fa9-8e6834eabd54.png",
        "https://cloud.githubusercontent.com/assets/6759634/22859179/fa0a06a6-f0b1-11e6-8103-f9dc9699f313.png"
    ],
    "authors": {
        "Patricio Aguirre": "[email protected]"
    },
    "social_media_url": "https://twitter.com/@patoman007",
    "source": {
        "git": "https://github.com/patoman007/HSBColorWheelPicker.git",
        "tag": "0.1.2"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "8.3"
    },
    "frameworks": "UIKit",
    "source_files": "HSBColorWheelPicker/Classes/**/*",
    "pushed_with_swift_version": "3"
}

Pin It on Pinterest

Share This