Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color wheel or color picker in iOS

How can I make a color wheel, color picker, or hue selector in iOS for use on the iPad.

Here is an example picture of a color picker similar to what I want.

enter image description here

@All Thanks in advance.

like image 524
user891268 Avatar asked Aug 24 '11 09:08

user891268


1 Answers

You don't need 3rd party code if you target your app to iOS 14. It has the UIColorPickerViewController and it's quite straightforward.

let picker = UIColorPickerViewController()
picker.delegate = self
present(picker, animated: true, completion: nil)

You can set the intitial selectedColor, or change supportsAlpha to false to hide the alpha slider and only allow opaque colors.

UIColorPickerViewController

like image 182
ricardopereira Avatar answered Oct 04 '22 05:10

ricardopereira