While she was in Timberline Knolls rehab, Kesha wrote “Rainbow” on her tiny toy keyboard. She wanted this song to be produced by Ben Folds, who just happened to have friends who could play cellos and violas and kettle drums and the oboe and the flute and the French horn. He called in all his favors, and they rented out the big room at Capitol Records and tried to do the song fast and cheap. Folds produced the final version using just two takes.
Source: The New York Times
The song was first mentioned in an interview with The New York Times. The interviewer stated "if it ever emerges from private listenings, it will be your favorite Kesha song. It’s big and sweeping, and you can hear every instrument that Ben Folds and his associates played — it does recall a Beach Boys vibe, just as she wanted it to. And as Folds said, the way she sings the song is so rich and so real that it jerks you out of your expectation of a pop song. In the final section, her voice becomes stronger and more strained, and the effect is devastating. I asked to hear it three more times."
“I found a rainbow, rainbow, baby,”
“Trust me, I know life is scary, but just put those colors on, girl, and come and paint the world with me tonight.”