Unlike the color development mechanism of pigments and dyes, the structural color is determined by the surface microstructure. Therefore, the structural color has the advantages of no pollution, not easy to fade, and high resolution, etc. However, there are still obstacles such as poor real-time dynamic control for the practical application of structural color. In this article, hexagonal boron nitride (h-BN) is introduced into metasurfaces to further explore tunable structural colors. Using the designed metasurface, we simulated three primary colors of red, green, and blue by adjusting the structural parameters, and realized the dynamic control of colors by adjusting the refractive index of h-BN. When the real part n of the complex refractive index of h-BN is adjusted by 0.1, the chromaticity coordinates in the x-direction change by about 0.025. As the real part n increases, the chromaticity coordinates in the color space shift from reddish orange to pink. Furthermore, as an application, we investigated the changes in the structural color of the proposed metasurface induced by the ambient refractive index. The results suggest that the proposed metasurface can be used to monitor or perceive the parameter changes in the background material by observing the color change of the metasurface. Our investigation provides theoretical references and new possibilities for the experimental research and applications of tunable structural color.