Outrageously colorfull flag from North Africa

I found the beylical flag of Tunisia on FotW1 and then WikipediA as a vector image2. I personally enjoy this flag because it is so outrageous in its colors and symbols and patterns.


I know your initiall reaction is probably of the “Doctor, my eyes!” nature, but take a look at it in detail. I would love to know what the symbolism of the little stars and circles was, and the colors and their patterns. The top and bottom symbols’ colors are not symmetric. Was that an accident? What about the colors on the handle of the sword of Ali in the middle?