How would I create these buttons, so that clicking handles correctly?

Each button is a .png, transparent outside of the coloured square. I need a transparent areas to be click-thru.
How would I create these buttons, so that clicking handles correctly?

Each button is a .png, transparent outside of the coloured square. I need a transparent areas to be click-thru.