The influence of the Co3+ spin state on the optical properties of LaCoO3 and HoCoO3