VGUI Question



	local slider = vgui.Create("DEXNumSlider", toppanel)
	slider:SetDecimals(0)
	slider:SetMinMax(0, 100)
	slider:SetConVar("test")
	slider:SetText("Test")
	slider:SizeToContents()
	slider:Dock(FILL)
	slider:DockMargin(0, 0, 16, 0)


I was wondering how would I set the text color to this, as by default it is a color I don’t want.
I tried something like…
slider:SetTextColor( Color(0, 0, 0) )
It seems to give me this error in console though



[ERROR] addons/test/lua/test/cl_init.lua:215: attempt to call method 'SetTextColor' (a nil value)
  1. OpenMenu - addons/test/lua/test/cl_init.lua:215
   2. fn - addons/test/lua/test/cl_init.lua:13
    3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183


What would I be doing to set the text color( Because i’m clearly doing something wrong here )

Try using slider:SetColor( Color(0, 0, 0) )

Same error.
Specifically, i’m trying to get the “Test” Text to change color, rather then the entire slider.


slider:SetTextColor(Color(255, 255, 255))

should work.

There is nothing called dexnumslider only dnumslider so it should be


local slider = vgui.Create("DNumSlider", toppanel)

Nope, the error is pointing towards
:SetTextColor
:SetColor