Different inorganic anions tuning halogen-bonding contacts to form different 3D networks with various absorption and emission properties.