Method for dyeing human keratin fibers comprises: applying a composition comprising, in a medium, at least one plant extract containing at least one heterocyclic compounds (I) and/or (II); and at least one base comprising sodium hydroxide, potassium hydroxide, calcium hydroxide, cesium hydroxide, barium hydroxide, lithium hydroxide, strontium hydroxide, rubidium hydroxide, magnesium hydroxide, urea, guanidine and/or guanidine carbonate. Method for dyeing human keratin fibers comprises: applying a composition comprising, in a medium, at least one plant extract containing at least one heterocyclic compounds of formula (I) and/or (II); and at least one base comprising sodium hydroxide, potassium hydroxide, calcium hydroxide, cesium hydroxide, barium hydroxide, lithium hydroxide, strontium hydroxide, rubidium hydroxide, magnesium hydroxide, urea, guanidine and/or guanidine carbonate. R1 : H, methyl, hydroxymethyl, aldehyde, group of formula (-CO 2R4), or -CH 2-glucose; R4 : H or 1-2C alkyl; R2 : H, OH or glucose group; R3 : OH or 1-4C alkyloxy; n : 1-5, when n is less than 2, then unsubstituted carbon atoms carried H; R5 : group of formula -CO 2R6a (c); R6a : H, 1-2C alkyl, alkaline earth metal or ammonium group; and R6 : H or group (c). [Image].