{"name":"setLightColor","title":"setLightColor","type":"command","url":"https://community.bistudio.com/wiki/setLightColor","revid":309010,"updated":"2022-04-25T11:42:18Z","groups":["Lights"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"local"},"description":"Set diffuse color of light. Illuminates surfaces that are facing the light.","syntaxes":[{"syntax":"light setLightColor [r, g, b]","params":[{"name":"light","type":"Object","type_expr":"Object"},{"name":"r","type":"Number","description":"red value in range 0..1","type_expr":"Number"},{"name":"g","type":"Number","description":"green value in range 0..1","type_expr":"Number"},{"name":"b","type":"Number","description":"blue value in range 0..1","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"light"},"right":{"text":"[r, g, b]"}}],"examples":[{"code":["myLight setLightColor [0.5,0,0]; // produces red"]}],"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\"`\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\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."}]}