Polysilsesquioxane naphthalenediimide thermo and photochromic gels