Usually when I buy a train ticket, I get the orange ones that you normally get as you see below:
However, once I was buying a ticket at Motherwell (a rather big travel centre by SPT area standards). He opened the tray to remove a pair of orange tickets for the machine. I noticed there were, however, loads of other tickets! Purple ones, blue ones, green ones, colours that I've never seen before in my life! Well, not in rail tickets anyway. Presumably they're all used for something different. All I saw was the colour from the top, not what was on the tickets.
My question: what is each ticket colour used for?

However, once I was buying a ticket at Motherwell (a rather big travel centre by SPT area standards). He opened the tray to remove a pair of orange tickets for the machine. I noticed there were, however, loads of other tickets! Purple ones, blue ones, green ones, colours that I've never seen before in my life! Well, not in rail tickets anyway. Presumably they're all used for something different. All I saw was the colour from the top, not what was on the tickets.
My question: what is each ticket colour used for?