Sol-gel chromogenic materials and devices