Wrong Pablo the Catalonian flag is based upon the older County of Barcelona, their heirs then became count of Provence, Foix or Aragon, that's why all these entities nowadays share almost the same flag: the Senyera (Blood and Gold) which come from the House of Barcelona.
Please, not again... Stop telling me I am wrong, or otherwise prove it with accurate sources. The flag was first used when Aragon already included Catalonia, so you can not tell where was it used first - However, it was only used by the King of Aragon at that time, not by the County, so its documented origin is in Aragon. Search that if you wish. And "Catalan heirs became counts of Aragon" please no. Aragon stopped being a county long before the Crown included Catalan counties, and at any case the King of Aragon was the one ruling the county of Barcelona. The "house of Barcelona" thing is because Aragon started including those counties when a woman was the Queen, so the surname was his husband's one, the count of Barcelona.
And well I knew about that Andorran "king". Also, Andorra is the only country having Catalan as official in the whole of it, as three Spanish Autonomous communities have it as official too. (France should do it as well with regional languages, although I doubt the future FN president will want to do it .-.)