The colour(s) of the flag are defined in regulations published in the official journal and correspond to one or two most important tinctures used in the coat of arms.
Flags could be plain (one single colour) just with the coat of arms in the centre (used by municipalities headquartered both in cities and towns), quartered with two colours (used only by municipalities whose seat is a town) or gyronny with two colours (meaning that the seat of the municipality has the status of city).
The single exception to this rule can be found in the flag of the Lagos municipality, which is quartered diagonally (Portuguese franchado, or quartered per saltire), reflecting the association of the city with King Manuel I of Portugal, whose personal standard was also quartered per saltire.