What are the colours of railway flags?

While traveling by train, you might have seen railway men waving different colours flags at different times. Do you know what they mean? A red flag or a flag of any colour that is waved vigorously means only one thing…. STOP! A yellow flag tells the train driver to proceed with care, while a green, white or blue flag reassures him that it is okay to proceed.  A blue flag stuck on the side of a train means that it should not be moved because someone is working on it. A blue flag on a track means that nothing on that track should be moved. At night, the flags are replaced by lights of the same colour