Thermochromic and solvatochromic effects in poly(3-hexylthiophene)