Skip to content

raylib.GetColor

JoeStrout edited this page Apr 29, 2026 · 3 revisions

Get a Color struct from hexadecimal value

Parameters

Parameter Default Value Note
hexValue

Return value

Condition Return Value
(always) map

Notes

In C, this function is used to load colors from a hexadecimal integer, like c = GetColor(0xFF0000FF) (representing opaque red in this example).

MiniScript does not have hexadecimal literals, so this is not a terribly useful function in raylib-miniscript. But it might be useful if reading a 4-byte value from a RawData, perhaps from a binary file or web request.

Example

// Build a color from a 4-byte binary value
binaryValue = 4278190335  // decimal version of 0xFF0000FF
c = raylib.GetColor(binaryValue)
print c  // {"r": 255, "g": 0, "b": 0, "a": 255}

Clone this wiki locally