“Praying,” the lead single from Kesh­a’s first album in nearly five years, is as triumphant as songs come. Swelling pianos and career-best vocals frame the cut, which seemingly refers to the singer’s creative break from former producer Dr. Luke. (In a 2014 lawsuit, she accused him of sexual assault, among other allegations; Luke — real name: Lukasz Gottwald — has repeatedly denied all her claims, most of which were thrown out by a judge in April 2016, though one contract-related claim is still ongoing in court. She did not work directly with Luke on Rainbow, though it is being released through his Kemosabe label “with [his] approval,” according to a statement from his spokesperson.) But Rainbow, her rich, masterful third LP, is far more than a kiss-off to old demons — it’s an artistic feat, as Kesha unites stylistic forays with her sharp, weathered lyricism.

On 2012’s uneven Warrior, Kesha teamed with artists from will.i.am to Iggy Pop but lacked a unifying vision. Here she’s more chameleonic than ever — Rainbow contains both a glitzy, glam-rock rave-up with Eagles of Death Metal (“Boogie Feet”) and a brassy funk collab with the Dap-Kings Horns (“Woman”) — but the results jell. Still, whether she’s belting forlorn country with Dolly Parton on “Old Flames (Can’t Hold a Candle to You)” or practicing the synth pop that made her a star (“Hymn”), her authenticity never flags; Rainbow’s 14 tracks are pure, uncut Kesha.