An empirical relation between hardness and bond-ionicity in a crystal