back ground color change

hi there, ill just get to it.

im trying to change my background color for a day and night scene.

im useing 2.7

code:

import bge
from bge import render

def main():

cont = bge.logic.getCurrentController()
own = cont.owner

if own ["Color"] > 0.000:
    own["Color"] -= 0.001
else:
    own ["Color"] = 0.000       
    
render.setBackgroundColor([1,0,0,True])    

main()

i keep getting an error saying please use KX_Worldinfo

can someone help me please