The electronic structure and spectra of octacyanide complexes