image.new() is not working with parameter "color" as per 2.82a API, the color parameter is not accepted by image.new()
a work around with #bpy.data.images["texture"].generated_color = (1, 1, 1, 1) in the next line would achieve the same.