The balance between closed and open forms of spiropyrans in the solid state