The physical chemistry of dye adsorption