Dragon robes were black in the Qin Dynasty, because Qin itself was in a relatively arid area at that time, so the thirst for water was very strong. The water in the five elements represented black, and naturally it began to advocate black. Of course, there are also five elements that have been said throughout the ages. For example, Xia Dynasty replaced Huangdi as Mude, Shang Dynasty replaced Xia Jinde, and Zhou Dynasty replaced Shang Dynasty as Huode. Of course, the Qin dynasty replaced the Zhou dynasty as a water virtue, so it was natural to use black.
The early Han Dynasty was as black as the Qin Dynasty, but after Emperor Wu of the Han Dynasty, some red elements were added. The emperors of feudal society would choose colors according to the five elements of geomantic omen, and would not mix them at will. It was not until the Wei, Jin, Southern and Northern Dynasties that there was a yellow robe, because the rulers thought that the land was yellow, and wearing yellow would be beneficial to the long-term stability of the people.
It was not until after the Tang Dynasty that yellow was defined as the color of robes. Influenced by Confucianism, the emperor is regarded as the son of heaven, which is naturally linked with the sun. Yellow is also the color of the sun, so it has become a custom since then. Yellow is the exclusive color of emperors, and ordinary people don't need it. It represents a kind of identity and symbol, which is why the emperor chose different colors of clothes at different times.