Optical and infrared colors of transneptunian objects observed with HST