A method, performed in a video camera, of controlling an infrared cut, IR-cut, filter of the video camera, to switch between day mode and night mode, wherein the camera comprises an image sensor having a color filter array configured to allow the sensor to sense different color components at different regions of the sensor, comprising the steps of the image sensor measuring (1002; 1102) the amount of ambient light received by the image sensor and color components of the ambient light received by the image sensor, wherein the color components are determined by calculating the sum or integrated amount of ambient light received by the image sensor within specific wavelength intervals corresponding to the color components, and when the video camera is in day mode, determining a set of illuminants present in the scene and contributing to the ambient light intensity, by comparing the color components of ambient light received by the image sensor to a first set of characteristic values in the form of color components contributions associated with different illuminants, when the amount of ambient light received by the image sensor is lower than a first threshold, switching to night mode, and when the camera is in night mode, determining an IR light proportion of the ambient light received by the image sensor, by comparing the color components of ambient light received by the image sensor to a second set of characteristic values in the form of color component contributions associated with different IR light proportions, determining a visible light intensity based on the determined IR light proportion and the amount of ambient light received by the image sensor, when the visible light intensity is higher than a second threshold, switching to day mode, characterized by obtaining the second set of characteristic values by mixing a wavelength spectrum of each illuminant in the determined set of illuminants with spectrums of several different levels of IR light, such that the second set of characteristic values contains a plurality of characteristic values per illuminant, wherein the proportion of IR light per characteristic value in the second set comprises both IR light from the spectrum of the illuminant and from the spectrum of the added level of IR light. the image sensor measuring (1002; 1102) the amount of ambient light received by the image sensor and color components of the ambient light received by the image sensor, wherein the color components are determined by calculating the sum or integrated amount of ambient light received by the image sensor within specific wavelength intervals corresponding to the color components, and when the video camera is in day mode, determining a set of illuminants present in the scene and contributing to the ambient light intensity, by comparing the color components of ambient light received by the image sensor to a first set of characteristic values in the form of color components contributions associated with different illuminants, when the amount of ambient light received by the image sensor is lower than a first threshold, switching to night mode, and when the camera is in night mode, determining an IR light proportion of the ambient light received by the image sensor, by comparing the color components of ambient light received by the image sensor to a second set of characteristic values in the form of color component contributions associated with different IR light proportions, determining a visible light intensity based on the determined IR light proportion and the amount of ambient light received by the image sensor, when the visible light intensity is higher than a second threshold, switching to day mode, determining a set of illuminants present in the scene and contributing to the ambient light intensity, by comparing the color components of ambient light received by the image sensor to a first set of characteristic values in the form of color components contributions associated with different illuminants, when the amount of ambient light received by the image sensor is lower than a first threshold, switching to night mode, and when the camera is in night mode, determining an IR light proportion of the ambient light received by the image sensor, by comparing the color components of ambient light received by the image sensor to a second set of characteristic values in the form of color component contributions associated with different IR light proportions, determining a visible light intensity based on the determined IR light proportion and the amount of ambient light received by the image sensor, when the visible light intensity is higher than a second threshold, switching to day mode,