Although piano keys are now white, originally, they were intended to be coloured from red to blue to let the pianist know what octave they were playing in. Black keys were intended to be white.
Red, orange, yellow, green, blue, indigo and violet were the original colours. Not only could you sing a rainbow, but also play one on the piano. Rhapsody in Blue was composed on such a piano, and uses notes in just one octave. Symphony in Green and Concerto in Yellow were less popular.