# GRAPHICS::_GENERATE_SWATCH_TEXTURE

- **Hash:** `0x160921255327C591`
- **Namespace:** GRAPHICS
- **Runtime name (Lua/JS):** `GenerateSwatchTexture`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/GRAPHICS/_GENERATE_SWATCH_TEXTURE

## Signature

```c
void _GENERATE_SWATCH_TEXTURE(int slotId, Hash componentHash, int metapedType, BOOL p3);
```

## Parameters

- `slotId` (`int`)
- `componentHash` (`Hash`)
- `metapedType` (`int`)
- `p3` (`BOOL`)

## Returns

`void`

## Description

Example:
local hash = GetHashKey("CLOTHING_ITEM_M_EYES_001_TINT_001")
_GENERATE_SWATCH_TEXTURE(0, hash, 0, true)
metapedType: see 0xEC9A1261BF0CE510

## Usage

### Lua

```lua
GenerateSwatchTexture(slotId, componentHash, metapedType, p3)

-- always available, by hash
Citizen.InvokeNative(0x160921255327C591, slotId, componentHash, metapedType, p3)
```

### JavaScript

```js
GenerateSwatchTexture(slotId, componentHash, metapedType, p3);

// by hash
Citizen.invokeNative('0x160921255327C591', slotId, componentHash, metapedType, p3);
```

### C#

```csharp
Function.Call((Hash)0x160921255327C591, slotId, componentHash, metapedType, p3);
```

- Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat("name")` or a backtick literal like `` `name` ``.
- The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works.

## Related enums

- [eMetaPedType](https://natives.borderlinerp.com/enums/eMetaPedType.md) — 4 values

*Sources: alloc8or RDR3 NativeDB.*
