There are officially two flags of Bavaria: the striped type, and the lozenge type, both of which are white and blue. Both flags are historically associated with the royal Bavarian Wittelsbach family, which ruled Bavaria.
Both horizontal and vertical flags with stripes or white and blue lozenges without arms can be considered official for use as state and civil flag and as civil ensign (on lakes and rivers). The variants defaced with the arms are not only unofficial, but not considered legal. However, the de facto used civil flag is in most cases a lozenge-style flag with the arms and a very popular symbol of regional pride used and displayed throughout the state.
The exact shade of blue has never been set in stone, but most flags used by the public are approximately RGB 0-204-255; official use something closer to RGB 0-128-255. The lonzenges are neither set in number, except there must be at least 21, and the top right (incomplete) lozenge must be white. Some people believe the lozenges to be representative of the lakes and rivers of Bavaria; or their color to be that of the lakes or the sky or both (as in the Bavarian anthem, which says 'die Farben seines [or "deines"] Himmels, Weib und Blau' - 'the colors of His sky/heaven, white and blue'); but this has never been proven. The other argument is that they are historical.