gizmosachin / ColorSlider

🎨 Snapchat-style color picker in Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting color manually will not change the position of previewView

minseks opened this issue · comments

I'm on the horizontal mode.

Hello! I'm facing the same issue. Did you manage to solve it?

try this:

slider.color = some_color
let x = slider.gradientView.calculateSliderProgress(for: slider.internalColor)
slider.previewView?.transition(to: .active)
slider.centerPreview(at: CGPoint(x: x * slider.bounds.width, y: x * slider.bounds.height))

Hi, we can't do this because "calculateSliderProgress" and "centerPreview" are inaccessible due to 'internal' protection level

How to do this then?

I wonder this as well...

I will just fork this