gizmosachin / ColorSlider

🎨 Snapchat-style color picker in Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding white and black colors

TheSwiftyCoder opened this issue · comments

Trying to add additional white and black colors to the picker and failing. Any ideas on how to implement?

Thanks

commented

I Second this. Need option to add more colors

@iSaadSalman @jay-cohen You can already pick B/W color by dragging outside of the control.
Is this what you are looking for?

More of a visual representation. Ideally there should be a bool method which shows white and black above and below the color gradient. Maybe gesture detection allowing it to go straight to black/white if they are over it rather than the current way.

@jay-cohen @iSaadSalman @wassup- This will be added as part of a larger refactor in the coming weeks. Unfortunately in the current implementation, there's no single source of truth of which colors are used (it shows all HSB colors with hues between [0.0, 1.0], saturation 1, brightness 1).

commented

@gizmosachin Can you recommend a manual solution until you do the refactor you mentioned?

Thanks :)

@iSaadSalman You can modify commonInit to change which colors appear in the slider and updateForTouch to respond correctly when a touch moves within the slider, though it may be easier to add manual buttons for black and white to your app outside the ColorSlider.

commented

@gizmosachin Thanks for reply :)

@TheSwiftyCoder @iSaadSalman @wassup- There's an in-progress version of the refactor mentioned above that's available on this branch. There are a few breaking changes from the current version of ColorSlider, but the README and demo app have been updated to match. Ready for use now, should be merged in the next two weeks.

This has been merged in v4.0.

Perfect. Thanks @gizmosachin