First, I put hotspots over each section of the palette and tied that to trigger different states to change the color of the paint bucket next to it to match the color. I also added true/false variables so that clicking on the section of the palette will set it to "true", while setting the other sections as "false".
Next, I put freeform shapes over each part of the dinosaur that I wanted to be colored in, with different states corresponding to the different colors on the palette. I added hotspots over each of these pieces as well.
I then added triggers to change the states of the shapes over each part of the dinosaur to change a certain color when (1) selecting the corresponding hotspot and (2) to change to the color that matches the color on the palette that is set to "true".
I just added my source file to the demo in the comments on the right-hand sidebar if you want to explore how I did this. Let me know if you have any additional questions!