GuiLabelGetColor

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function gets the color of a label.

Syntax

int int int guiLabelGetColor ( gui-element theLabel )

OOP Syntax Help! I don't understand this!

Method: GuiLabel:getColor(...)
Counterpart: guiLabelSetColor


Required Arguments

  • theLabel: The label to get color.

Returns

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

Example

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

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI