The castle was built by John Leith of Harthill in the early years of the seventeenth century; his son was Patrick Leith, a passionate Royalist in those difficult civil war times. So passionate that he was executed aged 25, having first torched his own castle to stop the wretched Covenanters getting their dirty hands on it! (Charles II seemed to have a string of eccentric Scottish lairds in his entourage - Sir Thomas Urquhart of Cromarty fought with him at Worcester, was taken prisoner, did a translation of Rabelais' bawdy stories and later died laughing when Charles became king).
Like many other fine restored Scottish castles, it is now a private residence, having been beautifully restored in the 1970s using the traditional harled exterior. (I don't suppose anyone knows if it was originally pink).
And so ironically it has probably been occupied about as long since it was restored as it was when built in the 17th century.