Organic photochromic and thermochromic compounds