Open Sheshank-s opened 5 years ago
Sorry I started this, and then i had schol work. I'll get it done by the end of the day for sure! Also @griffpatch can you confirm this idea?
No hurry don't fret :) - Could you outline what your idea is in a little more detail?
Yeah!
When you input the hex code it updates the other things. I made the html already im just working on the js now
Cool!
Weird, since the popup is a react container, adding HTML to it breaks the popup (sliders don't work).
Never mind that ^ I found a work around
Hmm... I'm not able to change the color. I tried simulating the slider moving and then a click but the click won't happen at the place i want, it only goes to the beginning of the slider.
Do you have any ideas on how i can get it to work?
I don't know, but try to use the function setColor(color)
and look at https://github.com/LLK/scratch-paint/blob/develop/src/containers/color-picker.jsx
How would I be able to access that function from the extension though?
Interfacing with the existing framework can be really difficult, if not impossible... I am having great trouble finding creatine ways of doing things!
On Sat, 21 Sep 2019, 19:34 Sheshank Shankar, notifications@github.com wrote:
How would I be able to access that function from the extension though?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/griffpatch/Scratch3-Dev-Tools/issues/8?email_source=notifications&email_token=ABTM3PXQXGJ5KWF446AEJ2DQKZSM7A5CNFSM4IX6E622YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7IXIXY#issuecomment-533820511, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTM3PXP3RVHCNNM62NLKY3QKZSM7ANCNFSM4IX6E62Q .
@griffpatch Yeah... One option is we can set the left value of the slider to the correct places, and then the user would need to move one of the sliders a little bit to the left so that it updates... but that's a really crappy way of doing it.
@griffpatch @RaspberryPiFan Doing something like this
document.getElementsByClassName("slider_container_o2aIb")[0].click()
Resets the slider to 0. If there is a way to click at a certain position on the slider, that might work.
Another idea, we can generate an image in the extension, so that the user can click the extension, put in hex value, copy image, paste in scratch editor, then use color picker.
That's really time consuming for user though..
@griffpatch @RaspberryPiFan Doing something like this
document.getElementsByClassName("slider_container_o2aIb")[0].click()
Resets the slider to 0. If there is a way to click at a certain position on the slider, that might work.
Don't reference the class name ending in _o2aIb because this could change with each build of scratch. Instead you need to locate the element using a selector like this:
let find = document.querySelector('[class*=slidercontainer]')
@griffpatch Okay cool. Should I just make it so that it says underneath the hex code what the color brightness and saturation should be?
And then the user has to move the sliders, that should work!
What if we use the existing framework for the color picker to simulate using it?
I'm making this now on my branch. I'll send a merge request soon.