Application of terpyridyl ligands to tune the optical and electrochemical properties of a conducting polymer