The name Star of David, derived from the Hebrew "Magen David" (literally "Shield of David"), hints that there would be a direct connection between the star and (King) David.
legend states that David would have worn a Star of David on his shield, whenever he went into battle. Not a single shred of evidence was ever found for this however.
This hexagram was used during the ancient history as a magical sign by among others by the Greek, Romans and the Babylonians, and taken over later by among others the Jews. In the Middle ages the Jews used the hexagram specifically to the following three ends:
1- as a decoration
2- as a magical symbol
3-as an astrological symbol" north,south,east , west.up, down
In the ninth century AD the current countries Egypt, Syria, Israel and Iran one big Islamic state, ruled by one khalif Al Mutawakkil. This khalif obliged the non-Islamic population, being Christians, Jews and magicians, to wear certain distinguishing marks on top of their clothes. To the Jews this became a yellow spot..The Star of David was a sad symbol of the Holocaust, when the Nazis forced Jews to wear an identifying yellow star. under the Ottoman Empire.
This was as far as it is known the first time in history that Jews had to "mark" themselves. In the 13th until the 18th century AD
In 1933 Hitler decided that Jews in Germany had to wear a brand, and in particular with a Jew Star (the insulting name for the Star of David). On the colour the nazi's didn't have to think very long. This had to be yellow, because this colour had been common in a negative and stigmatizing way to Jews for centuries already
god forgive us and direct us to the right path