Color wheel or color picker in iOS

How to make a color wheel, color picker, or hue selector in iOS for use on an iPad.

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

enter image description here

@So tnank you.

+8
ios objective-c colors iphone ipad
source share
7 answers

This post can help you. One easy way to choose a color is to get the color of the pixel in the image you supply. This github project also has a complete color picker.

+9
source share

My color choice, integrates easily https://github.com/sakrist/VBColorPicker enter image description here

+6
source share

Found another pretty simple article ... with sample code here .

+2
source share

I know this question has already been given and accepted, but all the github projects mentioned here look outdated and outdated. I found RSColorPicker , which is easy to use and has all the features I was looking for. Most importantly, it is not outdated.

+2
source share

I thought I would throw my flower picker in the ring. I use it in my application, "Doodle" , and I spent a couple of weeks on it and tested it in the application. It contains a sample project to show you how to get started with it, and it is open under a MIT license. It supports any device (iOS 6+), any resolution, portrait and landscape. Favorites, recents, color by hue, color wheel and importing textures, as well as deleting and moving favorites to the foreground are supported.

I tried to combine the good pieces of all the other color pickers and make sure that the MIT license allows you to integrate into any project without any difficulties.

Github: https://github.com/jjxtra/DRColorPicker

Screenshots:

DRColorPicker iPhoneDRColorPicker iPadDRColorPicker iPhoneDRColorPicker iPadDRColorPicker iPhoneDRColorPicker iPad

+2
source share

Nothing wrong with the other answers. I'm just sharing another color choice created with Swift.

swift-colorwheel

+2
source share

I created a sector of the color wheel in the drawing (_ rect: CGRect). See here.

What is my color wheel: color wheel sector

This view is based on the following lines of code:

override func draw(_ rect: CGRect) { guard let context = UIGraphicsGetCurrentContext() else { return } // Choice width and x position of a rect where will be placed you picker for x in stride(from: bounds.midX - bounds.height, to: bounds.midX + bounds.height, by: elementSize) { // Choice height and y position of the rect for y in stride(from: 0, to: rect.height, by: elementSize) { // Select color for a point context.setFillColor(colorFor(x: x, y: y)) // Select color for the point with elementSize which we declare and init as class property context.fill(CGRect(x: x, y: y, width: elementSize, height: elementSize)) } } } 
0
source share

All Articles