Optical electronegativity and refractive index of materials