The first function of an ambient light sensor is to be insensitive to wavelengths outside the visible region. They do this by filtering the light, by measuring both visible and infrared and subtracting the infrared or through unique die-level construction.