Why is wearing a yellow hat unlucky?

Wearing a yellow hat may ruin our reputation. Yellow is a noble color. We all know that ancient emperors usually wore yellow hats, but for us ordinary people, wearing a yellow hat is not in the right position, which makes a good job worth having, but it affects our work fortune because we don't know how to wear a hat.