# setEffectColor (Shared)

> Tints an effect with a colour.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Effects
- **URL**: https://wiki.mymp.gg/en/setEffectColor

## Syntax

```lua
bool setEffectColor(effect effect, float r, float g, float b [, float a = 255])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `effect` | `effect` | The effect. |
| `r` | `float` | Red, from 0 to 255. |
| `g` | `float` | Green, from 0 to 255. |
| `b` | `float` | Blue, from 0 to 255. |
| `a` | `float` | Alpha, from 0 to 255. *(default: `255`)* |

## Returns

`true` if it changed. `false` with a wrong argument (logs a warning).

Values outside 0 to 255 are clamped and rounded. On the server, the change reaches every client. On a client, changing an effect the server created only holds on this client until the server sends its state again.

## Example

```lua
local smoke = createEffect("smoke_flare", 2495.1, -1687.4, 13.5)
setEffectColor(smoke, 80, 255, 120)
```

## See also

- [getEffectColor (Shared)](https://wiki.mymp.gg/en/getEffectColor.md): Reads an effect's colour.
- [setEffectScale (Shared)](https://wiki.mymp.gg/en/setEffectScale.md): Changes an effect's size.
- [createEffect (Shared)](https://wiki.mymp.gg/en/createEffect.md): Creates a particle effect in the world. On the server every client sees it; on a client, only that client does.
