Electronic spectra and structures of thiopyrylium and pyrylium cations