Optical properties of photochromic organic–inorganic composites