-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.GetColor
JoeStrout edited this page Apr 29, 2026
·
3 revisions
Get a Color struct from hexadecimal value
| Parameter | Default Value | Note |
|---|---|---|
| hexValue |
| Condition | Return Value |
|---|---|
| (always) | map |
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.
// 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}