Diffraction
gratings have a demonstrated value in optical applications, such as
monochromators and spectrometers. Recent efforts have been directed
at finding simple ways to manufacture diffraction gratings at low
cost and under mild conditions. Here we present a practical strategy
to fabricate a diffraction grating by simply treating an elastic photonic
crystal film with a gradient of stress. The film was made of non-close-packed
colloidal crystal arrays embedded in hydrogel polymer. Its photonic
band gap (PBG) could be tuned precisely by using varying levels of
pressure. Thus, when the elastic photonic crystal film was subjected
to a stress gradient, a novel diffraction grating with continuously
varying PBGs in the whole visible range could be achieved. The practical
application of this type of diffraction grating was demonstrated in
a miniaturized spectrometer system