A self-adaptive algorithm is proposed in this study to optimize optical parameters, such as correlated color temperature (CCT), color rendering index (CRI), and synthesized spectra, in a trichromatic white light-emitting diode (WLED) system. The key contributions of this algorithm include automatically finding target CCT values in different seasons and time periods, and optimizing the CRI values simultaneously under various CCT values. Comparing with the conventionally used algorithm for spectrum optimization, the realization of target values and running time of the proposed algorithm behaves excellent, which are significant in realization of real-time and automatic control in intelligent lighting.