Panel:SetFGColor
Description
Sets the foreground color of a panel.
For a Label or RichText, this is the color of its text.
This function calls Panel:SetFGColorEx internally.
This doesn't apply to all VGUI elements (such as DLabel) and its function varies between them
Arguments
Example
Creates a Label and sets its text color to white.
Example
Sets the foreground color of a RichText to match the chat box format.
-- Create a window frame
TextFrame = vgui.Create("DFrame")
TextFrame:SetSize(200, 50)
TextFrame:Center()
TextFrame:SetTitle("This is a color test")
TextFrame:MakePopup()
-- RichText panel
local richtext = vgui.Create("RichText", TextFrame)
richtext:Dock(FILL)
-- Sample text
richtext:SetText("Here is some light green text.")
-- When the panel is ready for layout, make the text light green
function richtext:PerformLayout()
self:SetFGColor(Color(153, 255, 153))
end
Output: 
