Introducing defect into photonic crystal produces transmission peaks that can be placed within the bandgap, and if defect is somehow tunable, than these peaks can be controlled (by electric, magnetic field or temperature).
In the simplest case of 1D photonic crystals (Bragg stacks) the incorporation of "defect" layer (layer with non-quarterwave thickness) creates a very narrow trasmission band in the high reflectance band with spectral position that correlates with the position of the "defect" layer in the stack