As I recently noted, the origins of the various modern martial arts’ belt-ranking systems are not shrouded in mystery. They all derive from The Judo Rank System:
In the days before Kano created Judo, there was no kyu/dan ranking system in the martial arts. A more traditional method of recognizing achievement was the presentation of certificates or scrolls, often with the secrets of the school inscribed. Kano started the modern rank system when he awarded shodan to two of his senior students (Shiro Saigo and Tsunejiro Tomita) in 1883. Even then, there was no external differentiation between yudansha (black belt ranks) and mudansha (those who hadn’t yet attained black belt ranking). Kano apparently began the custom of having his yudansha wear black obi (belts) in 1886. These obi weren’t the belts karateka and judoka wear today — Kano hadn’t invented the judogi (Judo uniform) yet, and his students were still practicing in kimono. They were the wide obi still worn with formal kimono. In 1907, Kano introduced the modern judogi and its modern obi, but he still only used white and black belt ranks.
[...]
Other colored belts for students who had not yet achieved black belt originated later, when Judo began being practiced outside of Japan. Mikonosuke Kawaishi is generally regarded as the first to introduce various colored belts in Europe in 1935 when he started to teach Judo in Paris. He felt that western students would show greater progress if they had a visible system of many colored belts recognizing achievement and providing regular incentives. This system included white, yellow, orange, green, blue, and purple belts before the traditional brown and black belts.The Judo practice uniform and belt system eventually spread to many of the other modern martial arts such as aikido and karate which adapted them for their purpose. Karateka in Okinawa didn’t use any sort of special uniform at all in the old days. The kyu/dan ranking system, and the modern karategi (modified judogi) were first adopted by Funakoshi in an effort to encourage karate’s acceptance by the Japanese. He awarded the first shodan ranks given in karate to Tokuda, Otsuka, Akiba, Shimizu, Hirose, Gima, and Kasuya on April 10, 1924. The adoption of the kyu/dan system and the adoption of a standard uniform based on the judogi were 2 of the 4 conditions which the Dai-Nippon Butokukai required before recognizing karate as a “real” martial art. If you look at photographs of Okinawan karateka training in the early part of this century, you’ll see that they were training in their everyday clothes.