cocoacocoa-touchslidercolor-pickercolor-wheel

How to create a color picker wheel slider?


Does anyone know how to create the following? I cannot find any tutorials.

I can get the effect without a slider, but it is not as smooth. Or I can incorporate the slider but not update the picker with the value as it expects CGPoints instead of Ints and expects it in the gesture.locationInView(colorWheel) format, which a standard CGPoint will not accept.

what I am trying to create


Solution

  • I was able to just use the color wheel as a background and used the slider value to change the hue

    func changeSet(changeValue: CGFloat) {
        var value = (360 - currentAngleGlobal) / 360 // I had to deduct from 360 as my values were inverted
        var color = UIColor(hue: CGFloat(value), saturation: 1, brightness: 1, alpha: 1)
        self.colorOutput.backgroundColor = color
    }