{"name":"setLightColor","operator":null,"title":"setLightColor","type":"command","url":"https://community.bistudio.com/wiki/setLightColor","revid":309010,"updated":"2022-04-25T11:42:18Z","groups":["Lights"],"status":"ok","replaced_by":[],"games":[{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"description":"Set diffuse color of light. Illuminates surfaces that are facing the light.","syntaxes":[{"syntax":"light setLightColor [r, g, b]","since":null,"effect":null,"exec":null,"params":[{"name":"light","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"light: Object"},{"name":"r","type":"Number","optional":false,"default":null,"description":"red value in range 0..1","types":["Number"],"since":null,"text":"r: Number - red value in range 0..1"},{"name":"g","type":"Number","optional":false,"default":null,"description":"green value in range 0..1","types":["Number"],"since":null,"text":"g: Number - green value in range 0..1"},{"name":"b","type":"Number","optional":false,"default":null,"description":"blue value in range 0..1","types":["Number"],"since":null,"text":"b: Number - blue value in range 0..1"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"light","types":["Object"]},"right":{"text":"[r, g, b]","types":["Array"]}}],"examples":[{"text":"```sqf\nmyLight setLightColor [0.5,0,0]; // produces red\n```","code":["myLight setLightColor [0.5,0,0]; // produces red"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["setLightAmbient","setLightBrightness","lightAttachObject","lightDetachObject","setLightIntensity","setLightAttenuation","setLightUseFlare","setLightFlareSize","setLightFlareMaxDistance","setLightDayLight","setLightIR"],"notes":[{"user":"Feersum","date":"2006-12-01T16:42:00Z","text":"Light can be created with command createVehicleLocal with special vehicle class `\"#lightpoint\"`\n\nfor example:\n\n```sqf\n_light = \"#lightpoint\" createVehicleLocal pos;\n_light setLightBrightness 1.0;\n_light setLightAmbient [0.0, 1.0, 0.0];\n_light setLightColor [0.0, 1.0, 0.0];\n_light lightAttachObject [_object, [0,0,0]];\n```"},{"user":"ColonelSandersLite","date":"2017-08-17T07:15:00Z","text":"To clarify:\n- setLightAmbient - Terrain and surrounding objects are bathed in this colour.\n- setLightColor - Controls the \"haze\" seen around the lightsource (ex flares)."},{"user":"ffur2007slx2_5","date":"2014-03-24T23:58:00Z","text":"1. In Arma 3 ver 1.14 setLightColor will also change the color of the flare when setLightUseFlare, setLightFlareSize and setLightFlareMaxDistance were used on the same light source. For example:\n\n```sqf\n_light setLightUseFlare true;\n_light setLightFlareSize 2;\n_light setLightFlareMaxDistance 60;\n_light setLightColor [1, 1, 1];\n```\n\n2. When both setLightAmbient and setLightColor are [0,0,0], there won’t be any visual presentation on the light source."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Lights","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}