On the use of theory to model, predict and understand the optical properties of organic and inorganic dyes