The present invention relates to a cosmetic composition comprising, in a cosmetically acceptable medium, (i) a supramolecular compound that may be obtained by reaction between: at least one oil bearing at least one nucleophilic reactive function chosen from OH and NH2, and at least one junction group capable of establishing hydrogen bonds with one or more partner junction groups, each pairing of a junction group involving at least three hydrogen bonds, the said junction group bearing at least one isocyanate or imidazole reactive function capable of reacting with the reactive function borne by the oil, the said junction group also comprising at least one unit of formula (I) or (II): (I) (II) (ii) at least one oil, chosen from apolar hydrocarbon-based oils and silicone oils, (iii) at least one dyestuff. The invention also relates to a cosmetic treatment process comprising the application of the said composition.