For direct bandgap semiconductors, the bandgap is inversely proportional to the lattice constant. For ternary semiconductor compounds such as AlGaAs, varying the Al composition will change the bandgap of the compound, as well as the lattice constant. Ternary compounds vary the concentration of the metals, Al and Ga. As such this leads to a variation in Al concentration from AlAs with no Ga concentration to GaAs, with no Al concentration. AlAs and GaAs are lattice-matched and can therefore be grown together using conventional methods. AlGaAs is direct bandgap for Al concentrations below 0.45.
For a quarternary compound InGaAsP, the concentration varies between InAs, InP, GaAs, and GaP. These concentrations are not lattice matched to each other and vary significantly in bandgap.
The relationship between bandgap and lattice constant also enables an increased bandgap with compressive lattice strain and a reduced bandgap for tensile strain.