We propose a technique for calculating the color separation gratings aimed at separating plane light beams of different wavelengths into different diffraction orders. The technique is based on minimizing the difference between prism complex transmission functions and the complex amplitudes of beams generated for different wavelengths. We derived an analytical expression for the profile of a color separation grating that generalizes the familiar gratings onto the case of a more general wavelength relations. The technique is used to design diffractive optical elements (DOEs) intended to generate desired light beams at different wavelengths. The DOE intended to operate two wavelengths is designed using a nonlinear superposition of phase functions describing required transformation of input beams for two different wavelengths.© (2004) COPYRIGHT SPIE--The International Society for Optical Engineering. Downloading of the abstract is permitted for personal use only.