Skip to content

qudia/QudiaColorWheel

Repository files navigation

QudiaColorWheel

Version License Platform

A color wheel/picker for watchOS based on Colorful that uses the Digital Crown as a brightness slider.

Screen Capture

Installation

QudiaColorWheel is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'QudiaColorWheel'

Usage

You can use QudiaColorWheel in a SwiftUI view structure, as well as QudiaColorWheelController in your storyboard, if you need to support watchOS 6.

Usage in a SwiftUI view structure

Just use QudiaColorWheel as a normal SwiftUI view.

var body: some View {
    VStack {
        Text("Select a Color")
        QudiaColorWheel()
    }
}

Usage in the Storyboard

To use QudiaColorWheel in the storyboard, add a new Hosting Controller and change its Custom Class as follows:

Class: QudiaColorWheelController
Module: QudiaColorWheel

Make sure to uncheck Inherit Module From Target.

Screen Capture

Attributes

To get all the different attributes and modify the selected color from SwiftUI, initialize QudiaColorWheelSettings.shared as an ObservedObject:

@ObservedObject var colorWheelSettings = QudiaColorWheelSettings.shared

You can get/set the currently selected color with colorWheelSettings.color.

To get the border color QudiaColorWheel is currently using for the thumb view, use colorWheelSettings.borderColor.

To get whether a color is light or dark, use colorWheelSettings.isLightColor.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

watchOS 6.2.1

Author

Qudia
https://qudia.io

License

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