# setLightColor (Client)

> Changes a light's colour.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Lights
- **URL**: https://wiki.mymp.gg/en/setLightColor

## Syntax

```lua
bool setLightColor(light light, color color)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `light` | `light` | The light. |
| `color` | `color` | Three numbers `r, g, b` (integers from 0 to 255) or a `tocolor` value. Alpha is ignored. |

## Returns

`true` if it changed. With a wrong argument it logs a warning and returns `false`.

## Example

```lua
local light = createPointLight(2495.1, -1687.4, 14.5, 12)
setTimer(function()
    setLightColor(light, math.random(0, 255), math.random(0, 255), math.random(0, 255))
end, 500, 0)
```

## See also

- [getLightColor (Client)](https://wiki.mymp.gg/en/getLightColor.md): Reads a light's colour.
- [setLightIntensity (Client)](https://wiki.mymp.gg/en/setLightIntensity.md): Changes a light's brightness.
- [createPointLight (Client)](https://wiki.mymp.gg/en/createPointLight.md): Creates a light that shines in every direction from a point. The light exists on this client only.
