World: backgroundColor

backgroundColor
  • Get/set the background color of the scene

Type:
  • float List [ r, g, b]
Values:
  • r = red color value

    Range: 0.00 to 1.00
  • g = green color value

    Range: 0.00 to 1.00
  • b = blue color value

    Range: 0.00 to 1.00
Background Color setting in Blender 3D
  • Properties menu >> World >> World >> Horizon Color
Sample Code

################  get the background color

# import bge module
import bge

# get the current scene
scene = bge.logic.getCurrentScene()

# get the world module
wrld = scene.world

# get the background color
background_color = wrld.backgroundColor

Sample Code

################  set the background color

# import bge module
import bge

# get the current scene
scene = bge.logic.getCurrentScene()

# get the world module
wrld = scene.world

# set the background color to yellow
wrld.backgroundColor = [ 0.5, 0.5, 0.0 ]