A flag is one of the hardest design briefs anybody ever accepts. The finished object will usually be seen at a distance, in motion, half-furled, from the back, in poor light, at roughly the size of a postage stamp held at arm's length. It has to work embroidered on a blazer, printed on a lapel pin and painted on the side of an aircraft. And it has to mean something to millions of people who were not consulted.

Remarkably, there is a discipline devoted to exactly this. The study of flags acquired the name vexillology in 1957, coined by the American scholar Whitney Smith from the Latin vexillum, a Roman cavalry standard. Smith went on to help found the North American Vexillological Association a decade later. What began as a collector's pursuit has become a body of practical design advice that city councils now hire consultants to apply.

Five rules that fit on a napkin

The most influential summary of that advice is a slim booklet called Good Flag, Bad Flag, compiled by Ted Kaye for NAVA. It reduces the whole business to five principles, and they are almost aggressively plain.

Keep it simple, to the point where a child could draw the flag from memory. Use meaningful symbolism, so the images, colours or patterns relate to what is being represented. Use two or three basic colours, chosen from a limited standard set so that they contrast strongly. Use no lettering or seals of any kind. And be distinctive or be related: avoid duplicating another flag, but borrow deliberately where you want to show a connection.

The child test is doing more work than it appears. A flag that can be drawn from memory is a flag that can be recognised at half a mile, reproduced by a fan with a marker pen, and stitched cheaply. The prohibition on lettering follows from simple physics: words are legible from one side only, and reverse out backwards on the other. Seals fail for the same reason plus another, since a design meant to be read at the size of a document is unreadable at the size of a flagpole.

NAVA has tested the principles with public surveys, and the results are consistent to the point of monotony. Simple, boldly coloured, memorable designs win. New Mexico's red sun symbol on yellow topped its survey of American state and Canadian provincial flags. At the other end, the flag of Pocatello, Idaho, came last in a subsequent survey of city flags, having managed to include a trademark notice. Pocatello adopted a new design in 2017, one that a child could indeed draw. The whole subject reached a wider audience when the radio producer Roman Mars devoted a 2015 talk to the strange badness of American city flags, which set off a small wave of civic redesigns.

An 800-year-old law about contrast

Behind the modern advice sits a much older convention inherited from heraldry: the rule of tincture. Medieval heralds sorted their palette into metals, meaning gold and silver, rendered in practice as yellow and white, and colours, meaning red, blue, black, green and purple. The rule holds that you do not place colour on colour, nor metal on metal. Red on blue is out. White on yellow is out. Red on white or gold on blue is exactly right.

The reasoning is not mystical, it is optical. Britannica notes that the principle behind the rule is visibility, and that the combinations it bans were understood to be hard to distinguish before heraldry formalised anything. Yellow beside white, or red beside blue, collapses into mush at distance or in low light, particularly on cloth that is moving. The heralds simply wrote down what any archer squinting across a muddy field already knew.

You can watch the rule being obeyed on flags every day. When two colours must sit next to each other in violation of it, designers insert a thin strip of white or yellow to separate them, a technique heralds called fimbriation. The Union Flag is the classic demonstration: the red cross of St George and the red saltire of St Patrick are each outlined in white so that red never actually touches blue. Once you have noticed it, you cannot stop noticing it.

The rule was always breakable by those who knew it. Heralds kept a category of arms deliberately designed to violate it, the best-known being the arms of Jerusalem, gold crosses on silver, a metal-on-metal arrangement so conspicuous that it announced itself as a special case.

Proportions, and one flag that refuses to be rectangular

Flags also carry a ratio, and the choices are surprisingly unstandardised. Two to three is the most common shape worldwide. The United Kingdom uses one to two, giving a notably long flag. The United States uses ten to nineteen, a ratio that looks arbitrary and is. Switzerland and Vatican City use squares, although the Swiss merchant ensign flown at sea is a rectangle, since a square flag reads badly on a moving ship.

And then there is Nepal, the one national flag that is not a quadrilateral at all. Britannica describes it as two united pennant shapes, crimson with a blue border, carrying stylised symbols of the moon and the sun. The usual account is that it fuses two older triangular pennants once flown separately. The flag in its present form dates from 1962.

What makes it genuinely extraordinary is the legal text. Nepal does not define its flag with a diagram and a ratio. The constitution defines it as a geometric construction, a sequence of instructions in words: draw a line AB of the required length, from A draw a line AC perpendicular to AB making AC equal to AB plus one third of AB, and onwards through a long series of steps that place every ray of the sun and every point of the crescent. The proportions of the finished flag emerge from the construction rather than being stated. It is, in effect, a national symbol specified as compass-and-straightedge homework, and drawing it correctly is a small rite of passage for Nepali schoolchildren.

What a new country reaches for

When a state comes into being, or reinvents itself, the design decisions get political fast. Newly independent African nations frequently adopted red, gold and green, the colours of Ethiopia, the one African state that had never been colonised, giving a whole continent a shared visual vocabulary. Arab states drew on the black, white, green and red of the Arab Revolt flag. Nordic countries adopted the off-centre cross, a family resemblance that says who your neighbours are before it says anything else.

South Africa in 1994 offers the clearest case of a flag built to do a specific job under pressure. The design, credited to the State Herald Fred Brownell, was adopted for the April 1994 elections as an interim measure and simply stayed. Its Y shape converging into a single horizontal band was a plain statement about diverging paths joining. Notably, the government has always declined to assign official meanings to the individual colours, leaving people free to read their own histories into them. It also breaks Kaye's colour rule outright, carrying six. Sometimes the brief overrides the guidance, and everyone involved knows it.

The counter-examples matter too. New Zealand held two referendums in 2015 and 2016 on replacing its flag, chose a silver fern design as the challenger, and then voted to keep what it already had. Fiji announced a redesign in 2015 and quietly abandoned it. A flag is not only a graphic problem. It is a proposal about who a group of people think they are, and rather often the answer that comes back is that they would rather not be asked.