2015-08-25 65 views
1

有谁知道如何创建以下内容?我找不到任何教程。如何创建颜色选择器轮滑块?

我可以得到没有滑块的效果,但它不是那么流畅。或者我可以合并滑块,但不会更新选择器的值,因为它需要CGPoint而不是Ints,并且需要使用gesture.locationInView(colorWheel)格式,这是标准CGPoint不接受的格式。

what I am trying to create

回答

0

我可以只使用色轮为背景,并使用滑块值来改变色调

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 
}