The present invention relates to a cosmetic composition comprising compounds or salts of formula (I) or formula (II), wherein R1 and R2 are both independently hydrogen (H), or a saturated, straight or branched C1-C8 alkyl group. More particularly, the present invention also relates to the use of said cosmetic composition for the prevention of the graying of hair and/or for restoration and/or maintenance of the natural hair color.