It used to be the case that auto paint factors could make up colour coded rattle can of paints while you wait. Either to manufacturers code or they can measure the actual colour from the car with an instrument. Particularly useful if paint has faded etc over the years. But bear in mind that metallic paints can change colour tone depending on how the metallic particles are laid down. Ie it can differ depending on which direction you spray from.
I say 'used to' because it doesnt seem to be as widely advertised as it once was, and some may no longer do it. They are usually located on business parks . The ones I used in the past were very helpful to amateur retail customers. The cost of a can was no more than buying one in Halfords , .And basic sundries such as body filler, abrasive papers, masking tape, rubbing compounds etc was often much cheaper. Or it was .