RedM Natives

_GET_COLOR_FROM_NAME

Hash0xB981DD2DFAF9B1C9
Runtime nameGetColorFromName
NamespaceHUD
SideClient
NameCommunity guess
Docs
Since build1207

Signature

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

Parameters

NameTypeDescription
colorNameHashHash—
redint*—
greenint*—
blueint*—
alphaint*—

Returns void

Description

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

Usage

Lua
local red, green, blue, alpha = GetColorFromName(colorNameHash)

-- always works, by hash
local red, green, blue, alpha = Citizen.InvokeNative(0xB981DD2DFAF9B1C9, colorNameHash, Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.PointerValueInt())
JavaScript and C#
JavaScript
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#
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

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.