# HUD::_GET_COLOR_FROM_NAME

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

## Signature

```c
void _GET_COLOR_FROM_NAME(Hash colorNameHash, int* red, int* green, int* blue, int* alpha);
```

## Parameters

- `colorNameHash` (`Hash`)
- `red` (`int*`)
- `green` (`int*`)
- `blue` (`int*`)
- `alpha` (`int*`)

## Returns

`void`

## Description

colorNameHash: https://alloc8or.re/rdr3/doc/enums/eColor.txt

## Usage

### Lua

```lua
local red, green, blue, alpha = GetColorFromName(colorNameHash)

-- always available, by hash
local red, green, blue, alpha = Citizen.InvokeNative(0xB981DD2DFAF9B1C9, colorNameHash, Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.PointerValueInt())
```

### JavaScript

```js
const [red, green, blue, alpha] = GetColorFromName(colorNameHash);

// by hash
const [red, green, blue, alpha] = Citizen.invokeNative('0xB981DD2DFAF9B1C9', colorNameHash, Citizen.pointerValueInt(), Citizen.pointerValueInt(), Citizen.pointerValueInt(), Citizen.pointerValueInt());
```

### C#

```csharp
var red = new OutputArgument();
var green = new OutputArgument();
var blue = new OutputArgument();
var alpha = new OutputArgument();
Function.Call((Hash)0xB981DD2DFAF9B1C9, colorNameHash, red, green, blue, alpha);
// red.GetResult<int>()
// green.GetResult<int>()
// blue.GetResult<int>()
// alpha.GetResult<int>()
```

- 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` ``.
- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
- 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.

*Sources: alloc8or RDR3 NativeDB.*
