Tunable optical properties of colloidal quantum dots in electrolytic environments