How to properly use shapes in dynamic callbacks?

Hi @Peyman ,

finally I understood what you are aiming for. To find a solution for this one took me a while! I created a stripped down version of your code, the basic functionality is given though.

trace_colors