Dye-containing polymers: methods for preparation of mechanochromic materials