Colloidal crystals have been used for creating stimuli-responsive photonic materials. Here, macroporous hydrogels are designed, through a simple and reproducible protocol, that rapidly and reversibly switch between highly transparent and structurally colored states. The macroporous hydrogels are prepared by film-casting photocurable dispersions of silica particles in hydrogel-forming resins and selectively removing silica particles. The silica particles spontaneously form a nonclose-packed array due to repulsive interparticle interaction, which form the regular array of cavities after removal. However, the cavities are randomly collapsed by drying, losing a long-range order and rendering the materials highly transparent. When the hydrogels are swollen by either water, ethanol, or the mixture, the regular array is restored, which develops brilliant structural colors. This switching is completed in tens of seconds and repeatable without any hysteresis. The resonant wavelength depends on the composition of the water-ethanol mixture, where the dramatic shift occurs in one-component-rich mixtures due to the composition of the hydrogel. Micropatterns can be designed to have distinct domains of the macroporous hydrogels, which are transparent at the dried state and disclose encrypted graphics and unique reflectance spectra at the wet state. This class of solvent-responsive photonic hydrogels is potentially useful for alcohol sensors and user-interactive anti-counterfeiting materials.