A tunable Fabry-Perot resonator is realized using metal-insulator-metal structure, in which the insulator is chitosan hydrogel. The chitosan swells in response to changes in relative humidity; this change affects transmissive structural color of the multilayer structure. This tunable resonator is utilized for a humidity sensor combined with a photovoltaic cell. The change in current through the photovoltaic cell provides rapid precise measurement of relative humidity, and the change in color of the multilayer provides an approximate, remotely-readable estimate. The response requires no power, so the device has numerous sensing applications.