guiLabelGetColor | Multi Theft Auto: Wiki Skip to content

guiLabelGetColor

Client-side
Server-side
Shared

Pair: guiLabelSetColor

This function gets the color of a label.

OOP Syntax Help! I don't understand this!

Syntax

int|false, ​int, ​int guiLabelGetColor ( ​gui-label theLabel )
Required arguments
  • theLabel: The label to get color.

Returns

Returns three int values, representing the amount of red, green, blue if successful, false otherwise.

  • int|false: r
  • int: g
  • int: b

Code Examples

client
local pLabel = guiCreateLabel(0.5, 0.5, 0.5, 0.5, 'Text', true)
guiLabelSetColor(pLabel, math.random(0, 255), math.random(0, 255), math.random(0, 255))
addCommandHandler('get_color_label', function()
local iR, iG, iB = guiLabelGetColor(pLabel)
outputChatBox(('Label color is r = %d, g = %d, b = %d'):format(iR, iG, iB))
end)

See Also

GUI Functions