guiLabelGetColor | Multi Theft Auto: Wiki Skip to content

guiLabelGetColor

Client-side
Server-side
Shared

Pair: guiLabelSetColor

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function gets the color of a label.

OOP Syntax Help! I don't understand this!

Syntax

int int int guiLabelGetColor ( gui-element theLabel )
Required Arguments
  • theLabel: The label to get color.

Returns

  • int int int: value

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

Code Examples

shared
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