You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have successfully implemented until the part that it takes an array of hex colors and initializes them correctly on the wheel.
The problem is that, I cannot move the thumbs after initializing, since the position calculation had me confused. I have provided a set of states and panhandlers for each color to the child-most component, and instead of the whole wheel background, my panhandlers wrap the thumbs.
With the order from parent to child, here is my code so far:
I am not sure if this can be implemented using only one PanGestureHandler. The other solution I have thought about was converting the x, y values emitted from the panGestureEvent with respect to the outermost container, but also no luck there.
The problem occurs at the following part inside HueSaturationWheel component:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello all,
This is my first post on discussions, so I am sorry for any mistakes in advance :)
I am trying to implement a color wheel that utilizes multiple thumbs with react-native-reanimated and react-native-pan-gesture-handler.
The implementation is an alteration of https://github.com/iyegoroff/react-native-reanimated-color-picker library.
I have successfully implemented until the part that it takes an array of hex colors and initializes them correctly on the wheel.
The problem is that, I cannot move the thumbs after initializing, since the position calculation had me confused. I have provided a set of states and panhandlers for each color to the child-most component, and instead of the whole wheel background, my panhandlers wrap the thumbs.
With the order from parent to child, here is my code so far:
Main Component:
WheelWrapper.js
HueSaturationWheel.js
Wheel.js
And my helpers are as follows:
The image generated to display the wheel:
The method for HSV conversion:
Methods for layout and gesture locations:
I am not sure if this can be implemented using only one PanGestureHandler. The other solution I have thought about was converting the x, y values emitted from the panGestureEvent with respect to the outermost container, but also no luck there.
The problem occurs at the following part inside HueSaturationWheel component:
Since isGestureStartedInsideCircle method return false everytime, the condition always calls the else part.
I am very new to the React Native Reanimated Library, so any help will be appreciated.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions