You may be surprised to learn that belt color is a fairly new invention and holds less mystical significance than commonly believed.
Once upon a time, notably in Japan, martial arts were graded on a Menkyo Kaiden system. The various martial systems developed by the Samurai began to break apart into Ryu Ha as different masters and families developed their own methods. as the family systems were transferred to select students of the next generation, certificates for Oku-Iri, Mokuroku, and Menkyo Kaiden were given. Menkyo Kaiden was often reserved for the individual slated to inherit the style and lead it moving forward.
Rank before Menkyo Kaiden was relatively unimportant as skills were tested in live combat. If the proponents lived, their art could be passed on. If not, Darwinism had it's way and there would be no more of it. As time went on and the Meiji Restoration took hold, there was less of a need for Samurai arts on the battlefield (or Samurai at all) and therefore the Ryu Ha had more free time to proliferate and spread their teachings.
Around 1882 an ambitious upstart named Jigoro Kano started making waves in the realm of jujitsu. Kano grew up a well educated boy and skillful practitioner of Tenshin Shinyo Ryu Jujitsu. But he was also an innovator and studied under multiple different teachers, eventually developing an art he called Judo. In 1883 Kano decided to separate his Judo students into two groups, the yudansha and mudansha. Yudansha referred to those students who were "graded" and deemed skillful, while the rest were mudansha.
Two students, Tsunejiro Tomita and Shiro Saigo were the first ever students of Judo to be awarded the title of Yudansha at the level of shodan, first degree. Three years later, in order to help differentiate advanced students from regular students, Kano decided to institute black belts for anyone above shodan and white belts for anyone below. Thus both the kyu-dan and the colored belt traditions were born...only a few short generations ago.
Kano was a skillful teacher and student of pedagogy. He was aware that external ranking and reward helped not only organize students (remember Japan has always been a very vertical society) but also incentivize students to achieve more. To that end he decided to integrate ten levels of yudansha to work up through.
Around 1922 a karateka named Funakoshi Gichin blipped onto the radar of Kano. Funakoshi was spreading the art of karate around Japan, and had conducted an impressive demonstration at Women's Higher Normal School. Shortly after, Kano and Funakoshi spent time together, and Funakoshi was suitably impressed by Kano's grading system. So much so he decided to integrate it into his own karate. From there it spread not just through judo and karate but most martial arts.
The addition of multi-colored kyu belts came a bit later, and not from Kano or Funakoshi. It is speculated (See: Dave Lowry, "In the Dojo") that a judoka named Mikonosuke Kawaishi transplanted to Europe and spearheaded the development there. This would have occurred around 1936. The idea and success of the project caught fire and spread back to Japan and Okinawa, eventually reaching the Judo being taught in the United States around 1950. It is unknown as to why the original colors became white, green, and brown, although many poetic suppositions have been made to try and fill the gap. The myriad of colors since then have even less of an explanation.
The kyu-dan method has spread so efficiently that we often don't consider a time without it.