In the paper, we present a new kind of function photonic crystal of which the refractive index is a function of space position. According to Fermat principle, we give the motion equations of light in one-dimensional, two-dimensional and three-dimensional function photonic crystals. For one-dimensional function photonic crystal, we give the dispersion relation, the band gap structure and the transmissivity, and we obtain wider or narrower band gap structure than that of conventional photonic crystal. We study the effects of the refractive index, the number of period, the incidence angle and the thickness of medium layer on photonic crystal band gap, and obtain some valuable laws. Our results give the theoretical support designing the photonic crystals of different band gap structures.