I have two blocks in HTML5 canvas.
- Blue block, i.e. fixed on canvas
- A yellow block that can be dragged with the mouse.
When someone moves a yellow block over a blue block, I want to change the color of the overlap or intersection areas to green. (see attached image for a clear view)

Since blue + yellow = green, is there a way to achieve this by changing the opacity level of the blocks or should I look for an overlapping area of ββthe two blocks and display a green block in this area or is there any other way
I would like to know what is the best approach to achieve this?
source share