A flag is a piece of fabric with a distinctive design that is usually rectangular and used as a symbol, as a signaling device, or decoration. The term flag is also used to refer to the graphic design
Graphic design
Graphic design is a creative process – most often involving a client and a designer and usually completed in conjunction with producers of form – undertaken in order to convey a specific message to a targeted audience...

 employed by a flag, or to its depiction in another medium.

The first flags were used to assist military coordination on battlefields, and flags have since evolved into a general tool for rudimentary signalling and identification, especially in environments where communication is similarly challenging (such as the maritime environment where semaphore
Flag semaphore
Semaphore Flags is the system for conveying information at a distance by means of visual signals with hand-held flags, rods, disks, paddles, or occasionally bare or gloved hands. Information is encoded by the position of the flags; it is read when the flag is in a fixed position...

 is used).