Metamaterial device allows chameleon-like behavior in the infrared