Garry's Mod Wiki

Revision Difference

DLabel:SetTextColor#513736

<function name="SetTextColor" parent="DLabel" type="panelfunc">⤶ <ispanel>yes</ispanel>⤶ <description>Sets the text color of the <page>DLabel</page>. This will take precedence over <page>DLabel:SetTextStyleColor</page>.</description>⤶ <realm>Client</realm>⤶ <args>⤶ <arg name="color" type="table">The text color. Uses the &lt;page&gt;Color&lt;/page&gt;.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Changes the text color to red.</description>⤶ <code>⤶ local frame = vgui.Create( "DFrame" )⤶ frame:SetTitle( "Text Color Example" )⤶ frame:SetSize( 300, 100 )⤶ frame:Center()⤶ frame:MakePopup()⤶ ⤶ local frame_label = vgui.Create( "DLabel", frame )⤶ frame_label:SetPos( 10, 30 )⤶ frame_label:SetTextColor( Color( 255, 0, 0) )⤶ </code>⤶ ⤶ </example>