Flavylium compounds are versatile molecules that comprise anthocyanins, the ubiquitous colorants used by Nature to confer colour to most flowers and fruits. They have found a wide range of applications in human technology, from the millenary colour paints described by the Roman architect Vitruvius, to their use as food additives, combining colour and antioxidant effects, and even as light absorbers in solar cells aiming at a greener solar energy conversion. Their rich complexity derives in part from their ability to switch between a variety of species (flavylium cations, neutral quinoidal bases, hemiketals and chalcones, and negatively charged phenolates) by means of external stimuli, such as pH, temperature and light. This critical review describes (i) the historical advancements in the understanding of the equilibria of their chemical reaction networks; (ii) their thermodynamics and kinetics; (iii) the mechanisms underlying their colour development, such as co-pigmentation and host-guest interactions; (iv) the photophysics and photochemistry that lead to photochromism; and (v) applications in solar cells, models for optical memories, photochromic soft materials such as ionic liquids and gels, and their properties in solid state materials (274 references).