A grating element has an interface configured to cause light beams, include N visible color lights, incident to the interface to diffract at different orders. An imaging lens is configured to focus the N visible color lights diffracted by the grating element. A sensor is configured to receive and detect the focused N visible color lights. The focused N visible color lights include at least a first color light and a second color light. The first color light is diffracted in a first diffraction order and corresponds to a first wavelength resolution for the first color light. The second color light is diffracted in a second diffraction order and corresponds to a second wavelength resolution for the second color light. The first diffraction order is higher than the second diffraction order and the first wavelength resolution is smaller than the second wavelength resolution.