Check this out.
The colour pickers and text elements all now have class names we work with.
Using a little trick of getting an element under a x,y position we can drag a colour pick onto an individual text element and change it’s colour.
Also if we click a colour picker ALL the text elements will change.
I have added an extension in the Head file so this will work for multiple scenes.
All commented in the project.
Toggle text Colors_MHv1.hypetemplate.zip (89.1 KB)
This on has a slight change. I originally had a timeout so that the dragged colour elements could get out of the way before we retrieve the element under the drag end point. If we did not do this we would get the colour element and not the text. (Think layers).
But it just dawned on me that it should work if we drop the zIndex down to 0 of the colour element that was dragged right after the drop.
This way even if it is still in the way, it will not be on top of the text element.
We reset it back late.
This works. Which means we can have the colour changes work quicker.
Also I scrapped using the class name for the colour and simply get the backgroundColor of the dragged element.
Toggle text Colors_MHv2.hypetemplate.zip (93.9 KB)