Chnaging line color and position when click

Hi all,

I am trying to implement a new game. Initially I have a line that is gray, each time the user clicks, I want to change the color to blue and move the line 5 pixels up, if the use clicks again the line color changes back to gray and moves again. how do I do that?

Thanks,

-Kousha