World: mistColor

mistColor
  • Get/set the mist 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
Mist Color setting in Blender 3D
  • By default, mistColor uses the Horizon (background) color as the starting Mist color
    • Properties menu >> World >> World >> Horizon Color
  • Setting the mistColor to a different color does not change the Horizon (background) color
Sample Code

################  get the mist color

# import bge module
import bge

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

# get the world module
wrld = scene.world

# get the mist color
mist_color = wrld.mistColor

Sample Code

################  set the mist color

# import bge module
import bge

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

# get the world module
wrld = scene.world

# set the mist color to yellow
wrld.mistColor = [ 0.5, 0.5, 0.0 ]