DLabel.GetColor

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:GetColor( )
Description:
Gets the Color Specified by DLabel.SetColor.
Returns: Table
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DLabel.GetColor]DLabel.GetColor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionGets Label Color upon clicking a Button.
Used onNewerClient.png
Code
function GetColor()
 
	local Frame = vgui.Create("DFrame")
	Frame:SetPos(10,10)
	Frame:SetSize(300,300)
	Frame:SetTitle("Get Color")
	Frame:SetSizable(true)
 
		local DermaButton = vgui.Create( "DButton", Frame )
		DermaButton:SetText( "Get The Color" )
		DermaButton:SetPos( 25, 50 )
		DermaButton:SetSize( 150, 20 )
 
 
		local label = vgui.Create( "DLabel", Frame )
		label:SetPos( 25, 125 )
                label:SetColor(Color(255,0,0,255))
 
 
		DermaButton.DoClick = function ()
								PrintTable(label.GetColor())
							end			
end
 
concommand.Add("TestColor", GetColor)
Output[r] = 255 [g] = 0 [b] = 0 [a] = 255


Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox