color / colour
color / colour
get/set the color of the light
Type: list [ r, g, b] -- float
r: red channel
Type: float from 0.0
to 1.0
g: green channel
Type: float from 0.0
to 1.0
b: blue channel
Type: float from 0.0
to 1.0
Sample Code
######################## get light color
# get the current scene
scene = GameLogic.getCurrentScene()
# get a list of the lights in the scene
lightList = scene.lights
# get the light named Lamp
light = lightList["OBLamp"]
# get the color of Lamp
col = light.color
######################## set light color
# get the current scene
scene = GameLogic.getCurrentScene()
# get a list of the lights in the scene
lightList = scene.lights
# get the light named Lamp
light = lightList["OBLamp"]
# set the color of Lamp to red
light.color = [ 1.0, 0.0, 0.0]
|