_GET_COLOR_FROM_NAME
Hash
0xB981DD2DFAF9B1C9Runtime name
GetColorFromNameNamespaceHUD
SideClient
NameCommunity guess
Docs
Since build1207
Signature
void _GET_COLOR_FROM_NAME(Hash colorNameHash, int* red, int* green, int* blue, int* alpha);Parameters
| Name | Type | Description |
|---|---|---|
colorNameHash | Hash | — |
red | int* | — |
green | int* | — |
blue | int* | — |
alpha | int* | — |
Returns void
Description
colorNameHash: https://alloc8or.re/rdr3/doc/enums/eColor.txt
Usage
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#
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());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.InvokeNativeneeds the number — passjoaat("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
InvokeNativewith the hash — it always works.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.