Widget color

Most of the work is done, but I can’t figure out how to color the other widget…
That is, there is a created widget “ColorMainWidget” and just “ColorWidget”, there are also two Data tables created, one called “ColorDataTable” and “MixColorDatatable”, and also two structures “ColorsStruct” “MixColorStruct” created. What, in principle, is the work of the project now, when the project is launched, a widget immediately appears, and there are three colors: red, yellow, blue. We can bring these colored squares to the stage, and they will remain there. But we can also mix them on the stage, for example: if you mix red and yellow, it will be orange, and the scene will be orange when mixed, and the orange color will be added to the palette (there is no color at the beginning). Demonstration of the code and the project itself on the video: Coloring objects using a widget question - YouTube
It is necessary to make the “Paint” widget receive information from the “ColorWidget”, and thus there was a coloring. I still don’t really understand how to do this, my head stops thinking, so if you tell me how to make another widget change color, then I will be very grateful…
Thanks in advance for your attention! (If necessary, I will throw off a link to the project so that they can try to do it, or change something)

I hope I understood it right. You can use onDrop to pass information from one widget to another and then mix colours like so:

That’s in the box on the right.

Thank you very much for your reply and feedback! I tried to do this, but for some reason nothing is displayed for me. I changed the main ColorWidget from Image to Border so that you can use Brush color, color blending works, but for some reason it doesn’t work in conjunction with another widget… I’m attaching a video: Rendering Issues - YouTube
Mixing the colors in the square itself isn’t necessary, but it looks great! It is possible, in principle, in a solid color, only red, or yellow, or orange

If all you need is to replace the colour:

Like this, right?:

Not sure how you organised things, in my case:

It’s a bunch of user widgets, the patches detect Drag and only the mixer implements onDrop functionality.


One thing I’d avoid is implementing both Drag & Drop in the very same user widget. Things may get confusing with who dropped what on whom.

1 Like

Thanks a lot for your help! I was already graded for the lab, but I completed it with a minimum score…
Sorry for the late reply, lots of other items to close. I basically have a widget with different colors. There are DataTables. By which the data is read, and the mixing itself, as shown in the videos above, and a new color is added to the palette. I tried to do it according to your pictures, but for some reason it still didn’t work, initially, I thought that somewhere I didn’t set the border instead of image (because initially everything was with the image component) if there is an opportunity to share the project, then I would be glad ! At least understand what I’m doing wrong…
If necessary, I can give a link to my project: Proj - Google Drive
Thank you very much for your time and effort! I really appreciate it. I’ll mark that the issue is resolved, because I think I’m starting to get a little stupid here…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.