Electronic absorption and fluorescence spectra of xanthene dyes in polymers