Scratch3-Dev-Tools icon indicating copy to clipboard operation
Scratch3-Dev-Tools copied to clipboard

Make an RGB number input for editor.

Open Sheshank-s opened this issue 6 years ago • 18 comments

I'm making this now on my branch. I'll send a merge request soon.

Sheshank-s avatar Sep 18 '19 12:09 Sheshank-s

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?

Sheshank-s avatar Sep 19 '19 13:09 Sheshank-s

No hurry don't fret :) - Could you outline what your idea is in a little more detail?

griffpatch avatar Sep 19 '19 16:09 griffpatch

Yeah! image

When you input the hex code it updates the other things. I made the html already im just working on the js now

Sheshank-s avatar Sep 19 '19 22:09 Sheshank-s

Cool!

griffpatch avatar Sep 19 '19 23:09 griffpatch

Weird, since the popup is a react container, adding HTML to it breaks the popup (sliders don't work).

Sheshank-s avatar Sep 20 '19 00:09 Sheshank-s

Never mind that ^ I found a work around

Sheshank-s avatar Sep 20 '19 00:09 Sheshank-s

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.

Sheshank-s avatar Sep 20 '19 05:09 Sheshank-s

Do you have any ideas on how i can get it to work?

Sheshank-s avatar Sep 20 '19 05:09 Sheshank-s

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

ghost avatar Sep 20 '19 17:09 ghost

How would I be able to access that function from the extension though?

Sheshank-s avatar Sep 21 '19 18:09 Sheshank-s

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, [email protected] 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 avatar Sep 21 '19 20:09 griffpatch

@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.

Sheshank-s avatar Sep 21 '19 21:09 Sheshank-s

@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.

Sheshank-s avatar Sep 21 '19 21:09 Sheshank-s

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..

Sheshank-s avatar Sep 21 '19 21:09 Sheshank-s

@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*=slider_container_]')

griffpatch avatar Sep 22 '19 01:09 griffpatch

@griffpatch Okay cool. Should I just make it so that it says underneath the hex code what the color brightness and saturation should be?

Sheshank-s avatar Sep 22 '19 14:09 Sheshank-s

image And then the user has to move the sliders, that should work!

Sheshank-s avatar Sep 22 '19 14:09 Sheshank-s

What if we use the existing framework for the color picker to simulate using it?

Explosion-Scratch avatar Jul 16 '20 02:07 Explosion-Scratch