Britannica: More than a thousand years ago a powerful state, Kyv Rus, was founded in an area that is now part of Ukraine. National flags did not exist at that time, but Kyiv Rus used as its symbol a Trident Head, which was resurrected when Ukraine became independent in 1918 and in 1991. The first national flag for Ukraine was adopted in 1848 by revolutionaries who wanted its western parts to be freed from Austro-Hungarian rule. They based their flag, consisting of equal horizontal stripes of yellow over blue, on the colours of the coat of arms used by the city of Lviv. The arms showed a golden lion on a blue shield, an emblem dating back many centuries. Late in 1918, the decision was made to reverse the stripes of the 1848 flag to reflect the symbolism of “blue skies over golden wheat fields.”
Brittanica may be mistaken on many points in the quote above. The colors of the flag can be seen long before 1848. They can be seen in the most famous painting of Ilya Repin “The Reply of the Zaporoshian Cossacks to the Turkish Sultan” which describes the historic events of the 17th century. Repin spent more than 10 years researching the details of the Ukrainian Cossacks and two flags – Blue and Yellow and Black and Red were the colors of the Cossack Hosts.
But the colors go much deeper in age than that. Famous French scholar Georges Dumézil (1898 – 1986) ascribed the use of this particular combination of yellow-blue colors to the times of the Indo-European epoch. And it is possible that it is not accidental that Ukraine and Sweden have the flags of similar colors. For details, check the “Cradle of Civilizations” book.