I have a number of different buttons which I have called
red, blue and green (instance name)

I want a piece of code that recognises which of the button red, blue, yellow and green has been chosen. Please note these are buttons and not radiobuttons.