A colorimetric sensor based on plasmonic nanoparticles (NPs) is a promising and convenient detection tool, but its reproducibility and adjustability remain a challenge because the NPs are mainly random and uncontrollable. Herein, a colorimetric sensor with good reversibility and reproducibility was prepared by embedding the two-dimensional (2D) Au NP arrays on the surface of the polyacrylamide hydrogel film to form 2D Au NP arrays attached a hydrogel composite. For this composite, with the change of the interspacing distance of Au NPs driven by the swelling-shrinking behavior of the hydrogel carrier, the diffraction peaks faded away and plasmonic coupling peaks appeared, accompanied by a series of obvious color changes (iridescence ↔ violet ↔ golden yellow ↔ red), which can be correlated to the applied water content. Importantly, the composite had good reproducibility as a result of a highly ordered array structure. Additionally, this colorimetric sensor with a dynamically tunable plasmonic band can be used as a high-quality surface-enhanced Raman scattering (SERS) substrate because the gap distance of the Au NPs can be uniformly controlled. We demonstrated that, as the active gap distance decreased, the SERS signals can be significantly intensified. When the water content reached 40%, this SERS substrate exhibited high sensitivity (10-10 M for 4-aminothiophenol and 10-9 M for thiram) and good reproducibility (relative standard deviation of <20%) using the excitation laser of 785 nm because of the small gap between two adjacent Au NPs and the highly ordered periodic structure. Such 2D Au NP arrays attached to a hydrogel composite could be a new strategy to obtain a high-quality colorimetric sensor and dynamic SERS substrate.