Photochromic spirocompounds and chromenes for sensing metal ions