> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/rgbatrans.md).

# npc.rgbatrans

```lua
npc.rgbatrans(r, g, b, a, frames)
```

|                         |                                      |
| ----------------------- | ------------------------------------ |
| id                      | `0x03B2`                             |
| arguments               | 5: Float, Float, Float, Float, Float |
| in NPC Kit              | yes                                  |
| measured from a kit NPC | returns                              |
| vanilla scripts         | 4772 calls in 178 of 1114 scripts    |

## What it does

Tints and fades the NPC's model to a colour and opacity over a number of frames. `(1, 1, 1, 1, n)` is the model's own look, fully visible; alpha `0` is invisible.

## Arguments

### `r` (Float)

### `g` (Float)

### `b` (Float)

The colour multiplier, `1` for each being the model's own colour.

### `a` (Float)

Opacity: `1` visible, `0` invisible.

### `frames` (Float)

How long the change takes; `0` at once. Vanilla: `(1, 1, 1, 0, 0)` 2,284 times and `(1, 1, 1, 1, 10)` 2,085 (the fade-in of an NPC), then `(1, 1, 1, 1, 0)`, `(1, 1, 1, 0, 15)`.

## Timing

Returns at once; the fade runs over the frames. Nothing waits for it: add a [wait](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/wait.md).

## In NPC Kit

Works on a kit NPC and on another in a talk: `npc.on("id").rgbatrans(1, 1, 1, 0, 15)`. Used by the magic-trick example to fade a wolf in and out.

## Used with

* [clearhidecomplete](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/clearhidecomplete.md) / [hidecomplete](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/hidecomplete.md): fade, then really hide.
* [wait](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/wait.md) for the fade's length.

## Example

```lua
appear = function()
    local wolf = npc.on("npckit_0010")
    wolf.rgbatrans(1, 1, 1, 0, 0);
    wolf.clearhidecomplete();
    wolf.show();
    wolf.rgbatrans(1, 1, 1, 1, 10);
    npc.wait(10);
end,
```
